mod_authz_internal: Fix wrong role name field in user_can_assume_role()

Made it reject the primary role since it compares against a non-existent
field, i.e. nil.
This commit is contained in:
Kim Alvefur 2023-03-09 16:02:55 +01:00
parent 11a3373e89
commit cb65c58950

View file

@ -193,7 +193,7 @@ end
function user_can_assume_role(user, role_name)
local primary_role = get_user_role(user);
if primary_role and primary_role.role_name == role_name then
if primary_role and primary_role.name == role_name then
return true;
end
local secondary_roles = get_user_secondary_roles(user);