blob: fff4af1d74a729c7f492ad244f72eaa9b72addb4 (
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
|
// Disable Controlling of Network Devices
polkit.addRule(function(action, subject) {
if (subject.user !== 'lightdm')
return undefined;
if (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;
}
});
// Disable Sleep and Wake
polkit.addRule(function(action, subject) {
if (subject.user !== 'lightdm')
return undefined;
if (action.id == "org.freedesktop.NetworkManager.sleep-wake") {
return polkit.Result.NO;
}
});
// Disable WiFi Sharing
polkit.addRule(function(action, subject) {
if (subject.user !== 'lightdm')
return undefined;
if ((action.id == "org.freedesktop.NetworkManager.wifi.share.protected" ||
action.id == "org.freedesktop.NetworkManager.wifi.share.open")) {
return polkit.Result.NO;
}
});
// Disable Settings Modifications
polkit.addRule(function(action, subject) {
if (subject.user !== 'lightdm')
return undefined;
if (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;
}
});
// Disable User Connections
polkit.addRule(function(action, subject) {
if (subject.user !== 'lightdm')
return undefined;
if (action.id == "org.freedesktop.NetworkManager.use-user-connections") {
return polkit.Result.NO;
}
});
// Enable Controlling of Network Connections
polkit.addRule(function(action, subject) {
if (subject.user !== 'lightdm')
return undefined;
if (action.id.match("org.freedesktop.NetworkManager.network-control") &&
subject.active == true) {
return polkit.Result.YES;
}
});
|