aboutsummaryrefslogtreecommitdiffstats
path: root/util/roles.lua
Commit message (Collapse)AuthorAgeFilesLines
* util.roles: Implement a serialization preparation metamethodKim Alvefur2023-03-261-0/+13
| | | | | | Should be able to roundtrip trough serialization. Also nice for debug and logging purposes where you might want more details than what the __tostring method provides.
* util: Prefix module imports with prosody namespaceKim Alvefur2023-03-171-3/+3
|
* util.roles: Add a :policies() method to iterate through available policiesMatthew Wild2022-10-071-0/+10
| | | | | | We don't expose the policies directly, to force people to go through :may(). However, there are times when we really just need to know what policies a role has inside it (e.g. for reporting or debugging purposes).
* util.roles: Return nil if the role has no explicit policy (fixes inheritance)Matthew Wild2022-10-071-1/+1
| | | | | | | | Previously, if the first inherited role had no opinion, it returned false and prevented further consultation of other inherited roles. This bug was found thanks to the implementation of missing test cases identified through mutation testing.
* util.roles: Add new utility module to consolidate role objects and methodsMatthew Wild2022-07-191-0/+100