refac: read the OAuth roles claim whenever an allowed-roles list is configured

Role extraction was gated on the admin-roles list as well, so clearing that list stopped the allowed-roles list being evaluated at all. Extraction now depends on the allowed-roles list alone, which is the setting that decides who may sign in; the admin-roles list keeps doing nothing but mapping a role. Instances that set an allowed-roles list and no admin roles will start assigning the user role from the list, and existing admins there are written down to user on their next OAuth sign-in, which is what that configuration asks for.
This commit is contained in:
Classic298 2026-09-18 00:47:22 +02:00
parent 58b36765a7
commit ceed81a026

View file

@ -1530,7 +1530,7 @@ class OAuthManager:
role = user.role if user else auth_config.DEFAULT_USER_ROLE
# Next block extracts the roles from the user data, accepting nested claims of any depth
if oauth_claim and oauth_allowed_roles and oauth_admin_roles:
if oauth_claim and oauth_allowed_roles:
claim_data = user_data
nested_claims = oauth_claim.split('.')
for nested_claim in nested_claims: