aboutsummaryrefslogtreecommitdiff
path: root/lib/permissions.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-09-21 02:33:04 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-09-21 02:33:04 -0700
commit5f2db8da0e99fca282265b232330f3f432b94373 (patch)
tree5c27a1f958b55a15b0e35139165c885574d4fa3a /lib/permissions.nom
parent371548150618d5b3501f388972077b5d035f7d8a (diff)
Everything fixed up and some reduced lua codespew too!
Diffstat (limited to 'lib/permissions.nom')
-rw-r--r--lib/permissions.nom21
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/permissions.nom b/lib/permissions.nom
index 4b6c428..fd55ec8 100644
--- a/lib/permissions.nom
+++ b/lib/permissions.nom
@@ -5,35 +5,40 @@ require "lib/collections.nom"
# Permission functions
rule [restrict %rules to within %elite-rules] =:
+ say ".."|Restricting \%rules\ to within \%elite-rules\
%rules =: compiler "get_invocations" [%rules]
%elite-rules =: compiler "get_invocations" [%elite-rules]
for all (flatten [%elite-rules, %rules]):
- assert ((compiler's "defs") has %it) ".."|Undefined function: \%it\
+ assert ((compiler's "defs") has key %it) ".."|Undefined function: \%it\
for all %rules:
- assert (not (compiler "check_permission" [%it])) ".."
+ assert (compiler "check_permission" [%it]) ".."
|You do not have permission to restrict permissions for function: \%it\
- ((compiler's "defs")'s %it)'s "whiteset" =: dict (..)
- [%it, (yes)] for %it in %elite-rules
+ %foo =: dict (..)
+ [%it, yes] for %it in %elite-rules
+ say ".."|FFS: \%foo\
+ ((compiler's "defs")'s %it)'s "whiteset" =: %foo
rule [allow %elite-rules to use %rules] =:
+ say ".."|Allowing \%elite-rules\ to use \%rules\
%rules =: compiler "get_invocations" [%rules]
%elite-rules =: compiler "get_invocations" [%elite-rules]
for all (flatten [%elite-rules, %rules]):
- assert ((compiler's "defs") has %it) ".."|Undefined function: \%it\
+ assert ((compiler's "defs") has key %it) ".."|Undefined function: \%it\
for %fn in %rules:
- assert (not (compiler "check_permission" [%fn])) ".."
+ assert (compiler "check_permission" [%fn]) ".."
|You do not have permission to grant permissions for function: \%fn\
%whiteset =: ((compiler's "defs")'s %fn)'s "whiteset"
if (not %whiteset): on to the next %fn
for all %elite-rules: %whiteset's %it =: yes
rule [forbid %pleb-rules to use %rules] =:
+ say ".."|Forbidding \%pleb-rules\ to use \%rules\
%rules =: compiler "get_invocations" [%rules]
%pleb-rules =: compiler "get_invocations" [%pleb-rules]
for all (flatten [%pleb-rules, %used]):
- assert ((compiler's "defs") has %it) ".."|Undefined function: \%it\
+ assert ((compiler's "defs") has key %it) ".."|Undefined function: \%it\
for all %rules:
- assert (not (compiler "check_permission" [%it])) ".."
+ assert (compiler "check_permission" [%it]) ".."
|You do not have permission to grant permissions for function: \%it\
%whiteset =: ((compiler's "defs")'s %it)'s "whiteset"
assert %whiteset ".."