Diff

plugins/mod_authz_internal.lua @ 12920:cdb996637b08

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?
author Kim Alvefur <zash@zash.se>
date Sat, 04 Mar 2023 18:40:43 +0100
parent 12740:f58c6ae5edc1
child 12925:6cb339423928
line wrap: on
line diff
--- a/plugins/mod_authz_internal.lua	Thu Mar 02 22:34:29 2023 +0100
+++ b/plugins/mod_authz_internal.lua	Sat Mar 04 18:40:43 2023 +0100
@@ -280,6 +280,10 @@
 	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"));