diff options
author | David Zeuthen <zeuthen@gmail.com> | 2012-07-06 10:19:45 -0400 |
---|---|---|
committer | David Zeuthen <zeuthen@gmail.com> | 2012-07-06 10:19:45 -0400 |
commit | 50dcb370edc365114fa6640770ebc253d39570ab (patch) | |
tree | a200e0baae0cb81dff23b91ea8307b61aafd3a9a /src | |
parent | d45564a8b3b90c9dd990746ed082f4302fc017c1 (diff) | |
download | polkit-50dcb370edc365114fa6640770ebc253d39570ab.tar.gz |
Introduce a polkit.Result enumeration for authorization rules
This way an authorization rule can do this
return polkit.Result.YES;
which is slightly nicer than
return "yes";
https://bugs.freedesktop.org/show_bug.cgi?id=50983
Signed-off-by: David Zeuthen <zeuthen@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/polkitbackend/init.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/polkitbackend/init.js b/src/polkitbackend/init.js index 16862d4..af85d05 100644 --- a/src/polkitbackend/init.js +++ b/src/polkitbackend/init.js @@ -81,3 +81,13 @@ polkit._deleteRules = function() { this._adminRuleFuncs = []; this._ruleFuncs = []; }; + +polkit.Result = { + NO : "no", + YES : "yes", + AUTH_SELF : "auth_self", + AUTH_SELF_KEEP : "auth_self_keep", + AUTH_ADMIN : "auth_admin", + AUTH_ADMIN_KEEP : "auth_admin_keep", + NOT_HANDLED : null +}; |