mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-09 03:18:18 +00:00
fix(auth): enforce settings.interface permission on /user/settings/update endpoint (#25996)
This commit is contained in:
parent
ce4a323f43
commit
3c67774eb3
1 changed files with 8 additions and 0 deletions
|
|
@ -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 (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue