Skip to content

Commit d169f08

Browse files
Classic298oxsignalclaude
authored
fix: respect access_type in shared-chat file authorization branch (open-webui#24755)
has_access_to_file granted access whenever the file was attached to a shared chat the user could read, ignoring the requested access_type. A read-only shared-chat recipient therefore satisfied write and delete checks and could delete or mutate the chat owner's attached file. Gate the shared-chat branch on read access, matching the channels branch directly above it. Co-authored-by: oxsignal <oxsignal@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5d104ab commit d169f08

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • backend/open_webui/utils/access_control

backend/open_webui/utils/access_control/files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async def has_access_to_file(
6666

6767
# Check if the file is associated with any chats the user has access to
6868
shared_chat_ids = await Chats.get_shared_chat_ids_by_file_id(file_id, db=db)
69-
if shared_chat_ids:
69+
if access_type == 'read' and shared_chat_ids:
7070
accessible_ids = await AccessGrants.get_accessible_resource_ids(
7171
user_id=user.id,
7272
resource_type='shared_chat',

0 commit comments

Comments
 (0)