mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-13 01:02:25 -06:00
fix: persist access_grants.allow_groups in default permissions (#27124)
AccessGrantsPermissions only declared allow_users, so allow_groups was missing from the model backing the default user permissions endpoints. Pydantic ignores undeclared fields, so POST /users/default/permissions dropped allow_groups before model_dump(), it never reached the persisted user.permissions config, and fill_missing_permissions restored it to the default on the next read. Turning "Allow Sharing With Groups" off in Admin Settings silently reverted to on, while the same toggle worked when set per group, since group permissions are stored as a plain dict. GET /users/default/permissions and /users/default/permissions/defaults dropped it from their responses for the same reason. Declare allow_groups on the model so it round-trips, matching the access_grants block in DEFAULT_USER_PERMISSIONS. It defaults to True, so existing payloads that omit it are unaffected.
This commit is contained in:
@@ -207,6 +207,7 @@ class SharingPermissions(BaseModel):
|
||||
|
||||
class AccessGrantsPermissions(BaseModel):
|
||||
allow_users: bool = True
|
||||
allow_groups: bool = True
|
||||
|
||||
|
||||
class ChatPermissions(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user