Changeset

12733:2167e1639aab

mod_authz_internal: Allow specifying default role for public (remote) users
author Matthew Wild <mwild1@gmail.com>
date Thu, 29 Sep 2022 12:46:02 +0100
parents 12732:f731eda8a873
children 12734:447aef5e942c
files plugins/mod_authz_internal.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_authz_internal.lua	Thu Sep 29 12:43:09 2022 +0100
+++ b/plugins/mod_authz_internal.lua	Thu Sep 29 12:46:02 2022 +0100
@@ -16,6 +16,7 @@
 if is_component then
 	host_user_role = module:get_option_string("host_user_role", "prosody:user");
 	server_user_role = module:get_option_string("server_user_role");
+	public_user_role = module:get_option_string("public_user_role");
 end
 
 local role_store = module:open_store("account_roles");
@@ -240,6 +241,8 @@
 			return role_registry[host_user_role];
 		elseif server_user_role and hosts[user_host] then
 			return role_registry[server_user_role];
+		elseif public_user_role then
+			return role_registry[public_user_role];
 		end
 	end
 	return nil;