diff core/sessionmanager.lua @ 12648:f299e570a0fe

mod_authz_internal: Use util.roles, some API changes and config support This commit was too awkward to split (hg record didn't like it), so: - Switch to the new util.roles lib to provide a consistent representation of a role object. - Change API method from get_role_info() to get_role_by_name() (touches sessionmanager and usermanager) - Change get_roles() to get_user_roles(), take a username instead of a JID This is more consistent with all other usermanager API methods. - Support configuration of custom roles and permissions via the config file (to be documented).
author Matthew Wild <mwild1@gmail.com>
date Tue, 19 Jul 2022 18:02:02 +0100
parents 9061f9621330
children 07424992d7fc
line wrap: on
line diff
--- a/core/sessionmanager.lua	Tue Jul 19 17:44:26 2022 +0100
+++ b/core/sessionmanager.lua	Tue Jul 19 18:02:02 2022 +0100
@@ -133,7 +133,7 @@
 
 	local role;
 	if role_name then
-		role = hosts[session.host].authz.get_role_info(role_name);
+		role = hosts[session.host].authz.get_role_by_name(role_name);
 	else
 		role = hosts[session.host].authz.get_user_default_role(username);
 	end