mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-17 09:51:35 +00:00
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:
parent
58b36765a7
commit
ceed81a026
1 changed files with 1 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue