summaryrefslogtreecommitdiff
path: root/test/data/etc/polkit-1/rules.d/10-testing.rules
blob: 1c3a562852b91c28e8a0026cf7b2fa08883398ad (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
/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */

/* see test/polkitbackend/test-polkitbackendjsauthority.c */

/* NOTE: this is the /etc/polkit-1/rules.d version of 10-testing.rules */

polkit.addAdminRule(function(action, subject, details) {
    return ["unix-group:admin", "unix-user:root"];
});

polkit.addAdminRule(function(action, subject, details) {
    if (action == "net.company.action1") {
        return ["unix-group:admin"];
    }
});

polkit.addAdminRule(function(action, subject, details) {
    if (action == "net.company.action2") {
        return ["unix-group:users"];
    }
});

// -----

polkit.addRule(function(action, subject, details) {
    return "auth_admin";
});

polkit.addRule(function(action, subject, details) {
    if (action == "org.freedesktop.policykit.exec") {
        return "auth_admin";
    }
});