aboutsummaryrefslogtreecommitdiff
path: root/roles/xrdp/files/xrdp_polkit.rules
blob: c1fecde92991637f209fb4d5da2c6d418c736129 (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
polkit.addRule(function(action, subject) {
    if (subject.user && subject.user !== "root" &&
        (action.id == "org.freedesktop.color-manager.create-device" ||
         action.id == "org.freedesktop.color-manager.create-profile" ||
         action.id == "org.freedesktop.color-manager.delete-device" ||
         action.id == "org.freedesktop.color-manager.delete-profile" ||
         action.id == "org.freedesktop.color-manager.modify-device" ||
         action.id == "org.freedesktop.color-manager.modify-profile" ||
         action.id == "org.debian.apt.update-cache")) {
        return polkit.Result.YES;
    }
});

polkit.addRule(function(action, subject) {
    if (subject.user && subject.user !== "root" &&
        (action.id == "org.freedesktop.NetworkManager.settings.modify.system" ||
         action.id == "org.freedesktop.NetworkManager.network-control")) {
        return polkit.Result.YES;
    }
});

polkit.addRule(function(action, subject) {
    if (subject.user && subject.user !== "root" &&
        action.id.match(/^org\.freedesktop\.login1\.(reboot|power-off|suspend)/)) {
        if (subject.active) {
            return polkit.Result.YES;
        } else {
            return polkit.Result.NO;
        }
    }
});