summarylogtreecommitdiffstats
path: root/50-unity-greeter.rules
blob: 1c1b5a344662cfb52e21366c26cc2cc86f361c0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* Original:
 * [Disable Controlling of Network Devices]
 * Identity=unix-user:lightdm
 * Action=org.freedesktop.NetworkManager.enable-disable-network;org.freedesktop.NetworkManager.enable-disable-wifi;org.freedesktop.NetworkManager.enable-disable-wwan;org.freedesktop.NetworkManager.enable-disable-wimax;
 * ResultActive=no
 * ResultInactive=no
 * ResultsAny=no
 */

polkit.addRule(function(action, subject) {
  if (subject.user == "lightdm" && (
      action.id == "org.freedesktop.NetworkManager.enable-disable-network" ||
      action.id == "org.freedesktop.NetworkManager.enable-disable-wifi"    ||
      action.id == "org.freedesktop.NetworkManager.enable-disable-wwan"    ||
      action.id == "org.freedesktop.NetworkManager.enable-disable-wimax")) {
    return polkit.Result.NO;
  }
});

/* Original:
 * [Disable Sleep and Wake]
 * Identity=unix-user:lightdm
 * Action=org.freedesktop.NetworkManager.sleep-wake
 * ResultActive=no
 * ResultInactive=no
 * ResultsAny=no
 */
polkit.addRule(function(action, subject) {
  if (subject.user == "lightdm" &&
      action.id == "org.freedesktop.NetworkManager.sleep-wake") {
    return polkit.Result.NO;
  }
});

/* Original:
 * [Disable WiFi Sharing]
 * Identity=unix-user:lightdm
 * Action=org.freedesktop.NetworkManager.wifi.share.protected;org.freedesktop.NetworkManager.wifi.share.open
 * ResultActive=no
 * ResultInactive=no
 * ResultsAny=no
 */
polkit.addRule(function(action, subject) {
  if (subject.user == "lightdm" && (
      action.id == "org.freedesktop.NetworkManager.wifi.share.protected" ||
      action.id == "org.freedesktop.NetworkManager.wifi.share.open")) {
    return polkit.Result.NO;
  }
});

/* Original:
 * [Disable Settings Modifications]
 * Identity=unix-user:lightdm
 * Action=org.freedesktop.NetworkManager.settings.modify.own;org.freedesktop.NetworkManager.settings.modify.system;org.freedesktop.NetworkManager.settings.modify.hostname
 * ResultActive=no
 * ResultInactive=no
 * ResultsAny=no
 */
polkit.addRule(function(action, subject) {
  if (subject.user == "lightdm" && (
      action.id == "org.freedesktop.NetworkManager.settings.modify.own"    ||
      action.id == "org.freedesktop.NetworkManager.settings.modify.system" ||
      action.id == "org.freedesktop.NetworkManager.settings.modify.hostname")) {
    return polkit.Result.NO;
  }
});

/* Original:
 * [Disable User Connections]
 * Identity=unix-user:lightdm
 * Action=org.freedesktop.NetworkManager.use-user-connections
 * ResultActive=no
 * ResultInactive=no
 * ResultsAny=no
 */
polkit.addRule(function(action, subject) {
  if (subject.user == "lightdm" &&
      action.id == "org.freedesktop.NetworkManager.use-user-connections") {
    return polkit.Result.NO;
  }
});

/* Original:
 * [Enable Controlling of Network Connections]
 * Identity=unix-user:lightdm
 * Action=org.freedesktop.NetworkManager.network-control
 * ResultActive=yes
 * ResultInactive=no
 * ResultsAny=no
 */
polkit.addRule(function(action, subject) {
  if (subject.user == "lightdm" &&
      subject.local &&
      subject.active &&
      action.id == "org.freedesktop.NetworkManager.network-control") {
    return polkit.Result.YES;
  }
});