diff options
author | Matthew Wild <mwild1@gmail.com> | 2022-08-22 13:53:35 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2022-08-22 13:53:35 +0100 |
commit | e4ed9a570ab61ef45ca0e63dfd6d230e26812749 (patch) | |
tree | 361af05ddf1d012f9ce849528d36cfa83a0715ba /teal-src/util/roles.d.tl | |
parent | b79cb49bfba1d64dda54cf7243154624c53b5fb9 (diff) | |
parent | 227f6c033697210a54f671f5b9128cde8699fdcd (diff) | |
download | prosody-e4ed9a570ab61ef45ca0e63dfd6d230e26812749.tar.gz prosody-e4ed9a570ab61ef45ca0e63dfd6d230e26812749.zip |
Merge role-auth->trunk
Diffstat (limited to 'teal-src/util/roles.d.tl')
-rw-r--r-- | teal-src/util/roles.d.tl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/teal-src/util/roles.d.tl b/teal-src/util/roles.d.tl new file mode 100644 index 00000000..fef4f88a --- /dev/null +++ b/teal-src/util/roles.d.tl @@ -0,0 +1,32 @@ +local record util_roles + + type context = any + + record Role + id : string + name : string + description : string + default : boolean + priority : number -- or integer? + permissions : { string : boolean } + + may : function (Role, string, context) + clone : function (Role, role_config) + set_permission : function (Role, string, boolean, boolean) + end + + is_role : function (any) : boolean + + record role_config + name : string + description : string + default : boolean + priority : number -- or integer? + inherits : { Role } + permissions : { string : boolean } + end + + new : function (role_config, Role) : Role +end + +return util_roles |