summaryrefslogtreecommitdiff
path: root/test/data/etc/polkit-1/rules.d/10-testing.rules
blob: d4bb324dd3daed973b98c0ec3efd67ebe790c5a8 (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
/* -*- 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.addAdministratorRule(function(action, subject, details) {
    return ["unix-group:admin", "unix-user:root"];
});

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

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

// -----

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

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