diff options
Diffstat (limited to 'test/data')
5 files changed, 87 insertions, 0 deletions
diff --git a/test/data/etc/polkit-1/rules.d/15-testing.rules b/test/data/etc/polkit-1/rules.d/15-testing.rules index 00e214b..b1ae6dd 100644 --- a/test/data/etc/polkit-1/rules.d/15-testing.rules +++ b/test/data/etc/polkit-1/rules.d/15-testing.rules @@ -16,6 +16,12 @@ polkit.addRule(function(action, subject) { polkit.addRule(function(action, subject) { if (action.id == "net.company.order2") { + return polkit.Result.NO; // earlier rule should win + } +}); + +polkit.addRule(function(action, subject) { + if (action.id == "net.company.order3") { return polkit.Result.YES; } }); diff --git a/test/data/usr/local/share/polkit-1/rules.d/10-testing.rules b/test/data/usr/local/share/polkit-1/rules.d/10-testing.rules new file mode 100644 index 0000000..cf3cf26 --- /dev/null +++ b/test/data/usr/local/share/polkit-1/rules.d/10-testing.rules @@ -0,0 +1,24 @@ +/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */ + +/* see test/polkitbackend/test-polkitbackendjsauthority.c */ + +/* NOTE: this is the /usr/local/share/polkit-1/rules.d version of 10-testing.rules */ + +polkit.addRule(function(action, subject) { + if (action.id == "net.company.order0") { + return polkit.Result.NO; // earlier rule should win + } +}); + +polkit.addRule(function(action, subject) { + if (action.id == "net.company.order1") { + return polkit.Result.NO; // earlier rule should win + } +}); + +polkit.addRule(function(action, subject) { + if (action.id == "net.company.order2") { + return polkit.Result.YES; + } +}); + diff --git a/test/data/usr/local/share/polkit-1/rules.d/25-testing.rules b/test/data/usr/local/share/polkit-1/rules.d/25-testing.rules new file mode 100644 index 0000000..df373b6 --- /dev/null +++ b/test/data/usr/local/share/polkit-1/rules.d/25-testing.rules @@ -0,0 +1,39 @@ +/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */ + +/* see test/polkitbackend/test-polkitbackendjsauthority.c */ + +polkit.addRule(function(action, subject) { + if (action.id == "net.company.order0") { + return polkit.Result.NO; // earlier rule should win + } +}); + +polkit.addRule(function(action, subject) { + if (action.id == "net.company.order1") { + return polkit.Result.NO; // earlier rule should win + } +}); + +polkit.addRule(function(action, subject) { + if (action.id == "net.company.order2") { + return polkit.Result.NO; // earlier rule should win + } +}); + +polkit.addRule(function(action, subject) { + if (action.id == "net.company.order3") { + return polkit.Result.NO; // earlier rule should win + } +}); + +polkit.addRule(function(action, subject) { + if (action.id == "net.company.order4") { + return polkit.Result.NO; // earlier rule should win + } +}); + +polkit.addRule(function(action, subject) { + if (action.id == "net.company.order5") { + return polkit.Result.NO; // earlier rule should win + } +}); diff --git a/test/data/usr/share/polkit-1/rules.d/10-testing.rules b/test/data/usr/share/polkit-1/rules.d/10-testing.rules index 1d553f6..5650945 100644 --- a/test/data/usr/share/polkit-1/rules.d/10-testing.rules +++ b/test/data/usr/share/polkit-1/rules.d/10-testing.rules @@ -12,6 +12,12 @@ polkit.addRule(function(action, subject) { polkit.addRule(function(action, subject) { if (action.id == "net.company.order1") { + return polkit.Result.NO; // earlier rule should win + } +}); + +polkit.addRule(function(action, subject) { + if (action.id == "net.company.order2") { return polkit.Result.YES; } }); diff --git a/test/data/usr/share/polkit-1/rules.d/20-testing.rules b/test/data/usr/share/polkit-1/rules.d/20-testing.rules index 071f135..802577f 100644 --- a/test/data/usr/share/polkit-1/rules.d/20-testing.rules +++ b/test/data/usr/share/polkit-1/rules.d/20-testing.rules @@ -19,3 +19,15 @@ polkit.addRule(function(action, subject) { return polkit.Result.NO; // earlier rule should win } }); + +polkit.addRule(function(action, subject) { + if (action.id == "net.company.order3") { + return polkit.Result.NO; // earlier rule should win + } +}); + +polkit.addRule(function(action, subject) { + if (action.id == "net.company.order4") { + return polkit.Result.YES; + } +}); |