mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-25 04:24:30 -05:00
[PR #13480] [CLOSED] feat: Add Playground Access Control - Permission Setting #10007
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/13480
Author: @Classic298
Created: 5/4/2025
Status: ❌ Closed
Base:
dev← Head:dev📝 Commits (10+)
865b5bdUpdate users.py50575a2Update users.py02fb149Update translation.json75fbb87Update translation.jsoneaa9ff7Update translation.jsonc71e444Update translation.json08220a1Update translation.json00969f0Update translation.jsonbbcba47Update translation.json6bcacffUpdate translation.json📊 Changes
62 files changed (+157 additions, -67 deletions)
View changed files
📝
backend/open_webui/config.py(+8 -1)📝
backend/open_webui/routers/users.py(+1 -0)📝
src/lib/components/admin/Users/Groups.svelte(+1 -0)📝
src/lib/components/admin/Users/Groups/EditGroupModal.svelte(+2 -1)📝
src/lib/components/admin/Users/Groups/Permissions.svelte(+10 -0)📝
src/lib/components/layout/Sidebar/UserMenu.svelte(+3 -2)📝
src/lib/components/playground/Chat.svelte(+1 -1)📝
src/lib/components/playground/Completions.svelte(+1 -1)📝
src/lib/i18n/locales/ar-BH/translation.json(+1 -0)📝
src/lib/i18n/locales/ar/translation.json(+1 -0)📝
src/lib/i18n/locales/bg-BG/translation.json(+1 -0)📝
src/lib/i18n/locales/bn-BD/translation.json(+1 -0)📝
src/lib/i18n/locales/bo-TB/translation.json(+1 -0)📝
src/lib/i18n/locales/ca-ES/translation.json(+1 -0)📝
src/lib/i18n/locales/ceb-PH/translation.json(+1 -0)📝
src/lib/i18n/locales/cs-CZ/translation.json(+1 -0)📝
src/lib/i18n/locales/da-DK/translation.json(+1 -0)📝
src/lib/i18n/locales/de-DE/translation.json(+1 -0)📝
src/lib/i18n/locales/dg-DG/translation.json(+1 -0)📝
src/lib/i18n/locales/el-GR/translation.json(+1 -0)...and 42 more files
📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.feat: Add Playground Access Control
Description
Related issues / discussions:
This PR introduces a new permission setting,
playground_access, under "Features Permissions" to control user access to the Playground feature (/playground). Administrators can now manage this access instance-wide via Default Permissions or on a per-group basis within the Admin Panel.By default, Playground access is disabled (
false) for non-admin users but can be enabled via these new settings. Administrators always retain access to the Playground regardless of the permission setting.Changelog Entry
Added
playground_accessto thefeaturessection of user permissions.USER_PERMISSIONS_FEATURES_PLAYGROUND_ACCESSto configure the default value forplayground_access(defaults toFalse).src/lib/components/admin/Users/Groups/Permissions.svelte).src/routes/(app)/playground/+layout.svelte) checking for admin role orplayground_accesspermission."Playground Access"added, with German translation provided.Changed
src/lib/components/layout/Sidebar/UserMenu.svelte) is now conditionally displayed based on admin role orplayground_accesspermission.backend/open_webui/config.py) updated to include and process theUSER_PERMISSIONS_FEATURES_PLAYGROUND_ACCESSvariable and addplayground_accesstoDEFAULT_USER_PERMISSIONS.backend/open_webui/routers/users.py) updated via Pydantic model (FeaturesPermissions) to includeplayground_access.Permissions.svelte,EditGroupModal.svelte,Groups.svelte) updated to includeplayground_access.Security
/playgroundroutes.Additional Information
adminrole will always have access to the Playground, irrespective of theplayground_accesspermission setting./playground./playgroundto the homepage '/'.Screenshots or Videos
Please excuse the poor video quality and the suboptimal presentation, but the video does showcase how it works and that it works:
https://github.com/user-attachments/assets/9b865f16-2beb-4442-ab9b-cfb7935181d0
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the CONTRIBUTOR_LICENSE_AGREEMENT, and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.