aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-03-04 18:40:43 +0100
committerKim Alvefur <zash@zash.se>2023-03-04 18:40:43 +0100
commit4d46c278406e72d934823117eddfa2e7a35c8cc1 (patch)
treeea1df426b132ae01bd17d98352d3c646cef463a9 /plugins
parent7b7cad2b668fb94f84aa24396d3c2f72121d0083 (diff)
downloadprosody-4d46c278406e72d934823117eddfa2e7a35c8cc1.tar.gz
prosody-4d46c278406e72d934823117eddfa2e7a35c8cc1.zip
authz: Add method for retrieving all roles
Some of the OAuth stuff highlights a small need to retrieve a list of roles somehow. Handy if you ever need a role selector in adhoc or something. Unless there's some O(n) thing we were avoiding?
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_authz_internal.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mod_authz_internal.lua b/plugins/mod_authz_internal.lua
index c2895613..7e01e689 100644
--- a/plugins/mod_authz_internal.lua
+++ b/plugins/mod_authz_internal.lua
@@ -280,6 +280,10 @@ function get_role_by_name(role_name)
return assert(role_registry[role_name], role_name);
end
+function get_all_roles()
+ return role_registry;
+end
+
-- COMPAT: Migrate from 0.12 role storage
local function do_migration(migrate_host)
local old_role_store = assert(module:context(migrate_host):open_store("roles"));