blob: 4fce8c5e526a4f2e0b1c111ed26b21c70938ed31 (
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
|
/* -*- 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) {
if (action == "net.company.action1") {
return ["unix-group:admin"];
}
});
polkit.addAdminRule(function(action, subject, details) {
if (action == "net.company.action2") {
return ["unix-group:users"];
}
});
// Fallback
polkit.addAdminRule(function(action, subject, details) {
return ["unix-group:admin", "unix-user:root"];
});
// -----
polkit.addRule(function(action, subject, details) {
if (action == "net.company.productA.action0") {
return "auth_admin";
}
});
polkit.addRule(function(action, subject, details) {
if (action == "net.company.productA.action1") {
return "auth_self";
}
});
polkit.addRule(function(action, subject, details) {
if (action == "net.company.order0") {
details["test_detail"] = "a";
return "yes";
}
});
|