mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-13 01:02:25 -06:00
fix(auth): enforce settings.interface permission on /user/settings/update endpoint (#25996)
This commit is contained in:
@@ -324,6 +324,14 @@ async def update_user_settings_by_session_user(
|
||||
user=Depends(get_verified_user),
|
||||
db: AsyncSession = Depends(get_async_session),
|
||||
):
|
||||
if user.role != 'admin' and not await has_permission(
|
||||
user.id, 'settings.interface', request.app.state.config.USER_PERMISSIONS
|
||||
):
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
|
||||
)
|
||||
|
||||
updated_user_settings = form_data.model_dump()
|
||||
ui_settings = updated_user_settings.get('ui')
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user