From 4d46c278406e72d934823117eddfa2e7a35c8cc1 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 4 Mar 2023 18:40:43 +0100 Subject: 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? --- plugins/mod_authz_internal.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins/mod_authz_internal.lua') 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")); -- cgit v1.2.3