Comparison

teal-src/util/roles.d.tl @ 12661:1c391c17a907

util.roles: Add Teal interface declaration
author Kim Alvefur <zash@zash.se>
date Fri, 12 Aug 2022 22:09:09 +0200
comparison
equal deleted inserted replaced
12660:e8f57970ced5 12661:1c391c17a907
1 local record util_roles
2
3 type context = any
4
5 record Role
6 id : string
7 name : string
8 description : string
9 default : boolean
10 priority : number -- or integer?
11 permissions : { string : boolean }
12
13 may : function (Role, string, context)
14 clone : function (Role, role_config)
15 set_permission : function (Role, string, boolean, boolean)
16 end
17
18 is_role : function (any) : boolean
19
20 record role_config
21 name : string
22 description : string
23 default : boolean
24 priority : number -- or integer?
25 inherits : { Role }
26 permissions : { string : boolean }
27 end
28
29 new : function (role_config, Role) : Role
30 end
31
32 return util_roles