This commit is contained in:
Timothy Jaeryang Baek
2026-03-21 19:42:48 -05:00
parent 52e227f425
commit a1aceb5f87
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -504,7 +504,7 @@ async def ldap_auth(
user = Auths.authenticate_user_by_email(email, db=db) user = Auths.authenticate_user_by_email(email, db=db)
if user: if user:
if user.role != 'admin' and ENABLE_LDAP_GROUP_MANAGEMENT and user_groups: if ENABLE_LDAP_GROUP_MANAGEMENT and user_groups:
if ENABLE_LDAP_GROUP_CREATION: if ENABLE_LDAP_GROUP_CREATION:
Groups.create_groups_by_group_names(user.id, user_groups, db=db) Groups.create_groups_by_group_names(user.id, user_groups, db=db)
try: try:
@@ -565,7 +565,7 @@ async def signin(
) )
user = Auths.authenticate_user_by_email(email, db=db) user = Auths.authenticate_user_by_email(email, db=db)
if WEBUI_AUTH_TRUSTED_GROUPS_HEADER and user and user.role != 'admin': if WEBUI_AUTH_TRUSTED_GROUPS_HEADER and user:
group_names = request.headers.get(WEBUI_AUTH_TRUSTED_GROUPS_HEADER, '').split(',') group_names = request.headers.get(WEBUI_AUTH_TRUSTED_GROUPS_HEADER, '').split(',')
group_names = [name.strip() for name in group_names if name.strip()] group_names = [name.strip() for name in group_names if name.strip()]
+1 -1
View File
@@ -1508,7 +1508,7 @@ class OAuthManager:
data={'id': user.id}, data={'id': user.id},
expires_delta=parse_duration(auth_manager_config.JWT_EXPIRES_IN), expires_delta=parse_duration(auth_manager_config.JWT_EXPIRES_IN),
) )
if auth_manager_config.ENABLE_OAUTH_GROUP_MANAGEMENT and user.role != 'admin': if auth_manager_config.ENABLE_OAUTH_GROUP_MANAGEMENT:
self.update_user_groups( self.update_user_groups(
user=user, user=user,
user_data=user_data, user_data=user_data,