mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[PR #13644] [CLOSED] wip: roles and permissions #62113
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/13644
Author: @cableman
Created: 5/7/2025
Status: ❌ Closed
Base:
dev← Head:feature/roles-endpoint📝 Commits (10+)
d8c3f3bAdded roles model2222faeAdded migration for roles table4193720Added default roles to databased75be6bAdded roles routesa38cc2cAdded support for adding new roles6c754a3Added support for deleting role488bc03Ensured dynamic role assignment is used in oauth5e8925dAdded roles apis to frontendd93cb88Added support for dynamic roles in frontend8318cbfAdded support for dynamic roles in user add📊 Changes
27 files changed (+2584 additions, -518 deletions)
View changed files
📝
backend/open_webui/config.py(+39 -5)📝
backend/open_webui/constants.py(+16 -0)📝
backend/open_webui/main.py(+9 -1)➕
backend/open_webui/migrations/versions/04c6df61a317_added_permissions_to_database.py(+55 -0)➕
backend/open_webui/migrations/versions/262aff902ca3_added_roles_tabel.py(+49 -0)➕
backend/open_webui/models/permissions.py(+481 -0)➕
backend/open_webui/models/roles.py(+151 -0)📝
backend/open_webui/routers/auths.py(+5 -4)➕
backend/open_webui/routers/permissions.py(+49 -0)➕
backend/open_webui/routers/roles.py(+198 -0)📝
backend/open_webui/routers/users.py(+44 -22)📝
backend/open_webui/utils/oauth.py(+24 -2)➕
src/lib/apis/permissions/index.ts(+67 -0)➕
src/lib/apis/roles/index.ts(+214 -0)📝
src/lib/components/admin/Users.svelte(+46 -0)📝
src/lib/components/admin/Users/Groups.svelte(+1 -35)📝
src/lib/components/admin/Users/Groups/EditGroupModal.svelte(+11 -30)➖
src/lib/components/admin/Users/Groups/Permissions.svelte(+0 -393)➕
src/lib/components/admin/Users/PermissionList.svelte(+231 -0)➕
src/lib/components/admin/Users/Permissions/AddPermissionModal.svelte(+157 -0)...and 7 more files
📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
This pull request moved permission and roles into the database, but at the same time do not change the existing API end-point. The reason for moving roles and permissions into the database is to have different default permission for different roles and have the possibility to extend with new permission for "functions/tools"
in custom local code.
Added
Changed
Removed
Additional Information
Some of the data-structure for permission and roles are not optimal (e.g. the existing permission end-point do not contain labels). We have chosen to do it this way to ensure the existing APIs and data returned is not changed for existing sites out there.
Discussion: https://github.com/open-webui/open-webui/discussions/13200
Screenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), 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.