This pull request introduces a new user role, "content admin," and updates the system to accommodate this role. The "content admin" role has specific permissions, including the ability to manage documents.
Added
New User Role: Introduced the "content admin" role with specific permissions to manage documents within the environment. (purple button)
Changed
backend:
backend/apps/webui/routers/auths.py: Updated role handling logic to include "content admin" in configuration.
backend/apps/webui/routers/chats.py: Adjusted chat access permissions to accommodate "content admin."
backend/apps/webui/routers/documents.py: Modified API endpoints to manage document access and permissions for the "content admin" role.
backend/test/apps/webui/routers/test_auths.py: Updated test cases to reflect changes in role handling.
backend/utils/utils.py: Introduced utility functions to support the new role and permissions.
frontend:
Updated various components to handle the new role.
- src/lib/components/admin/AddUserModal.svelte: Added support for selecting "content admin" role.
- src/lib/components/admin/Settings/General.svelte: Added "content admin" option in role selection dropdown.
- src/lib/components/layout/Sidebar.svelte: Updated sidebar to show content admin specific links and options.
- src/routes/(app)/+layout.svelte: Updated layout logic to include the new role in routing and access control.
- src/routes/(app)/admin/+page.svelte: Enhanced user role handling to include "content admin" in role-based views.
- src/routes/(app)/workspace/+layout.svelte: Improved layout to handle role-based access for "content admin."
Deprecated
N/A
Removed
N/A
Fixed
N/A
Security
N/A
Breaking Changes
BREAKING CHANGE: BREAKING CHANGE: The introduction of the "content admin" role requires updates to both backend and frontend components. Ensure that the new role is handled appropriately in all affected areas.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/5121
**Author:** [@MarcRevo](https://github.com/MarcRevo)
**Created:** 9/3/2024
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `dev-content-admin`
---
### 📝 Commits (10+)
- [`8994728`](https://github.com/open-webui/open-webui/commit/8994728d8b432f3747335dbbcfdcf3d036d94ce1) Update translation.json
- [`6589450`](https://github.com/open-webui/open-webui/commit/6589450bd612c6489dbbd5fbfc709ed2482881f5) Merge pull request #4954 from open-webui/main
- [`0525dd2`](https://github.com/open-webui/open-webui/commit/0525dd2bb5c13c18c92654bd7e025dc254f5e8ac) feat: support Literal type in Tools
- [`30e03cb`](https://github.com/open-webui/open-webui/commit/30e03cbac40237aa1499eaecaba435aa36a4c248) Add robots.txt to fix validation error
- [`718d69b`](https://github.com/open-webui/open-webui/commit/718d69b148a0c526c9095d4a0aa28e1d55a265f6) Add meta description
- [`22117e0`](https://github.com/open-webui/open-webui/commit/22117e06b54ec8c962169c6a91fb2529a448aee4) A11y: Buttons do not have an accessible name
- [`7e1923f`](https://github.com/open-webui/open-webui/commit/7e1923fcfe18a109c3b8516e812197d7378ed887) Add searchapi as an alternative web search
- [`fd16129`](https://github.com/open-webui/open-webui/commit/fd1612935d1a912f31584c919fc7e6abc12186f5) Update color theme on system change
- [`2706b8c`](https://github.com/open-webui/open-webui/commit/2706b8c59c5898a5a7f4a8f2a7fa196b12e18b89) i18n: Update Catalan translation.json
- [`a7b6d55`](https://github.com/open-webui/open-webui/commit/a7b6d5507f4f3b134bbb2ee2cd3df99befbab39d) i18n: Update Catalan translation.json
### 📊 Changes
**86 files changed** (+1217 additions, -1071 deletions)
<details>
<summary>View changed files</summary>
📝 `.github/workflows/release-pypi.yml` (+1 -0)
📝 `README.md` (+1 -1)
📝 `backend/apps/audio/main.py` (+19 -32)
📝 `backend/apps/images/main.py` (+23 -35)
📝 `backend/apps/images/utils/comfyui.py` (+27 -12)
📝 `backend/apps/ollama/main.py` (+19 -33)
📝 `backend/apps/openai/main.py` (+21 -29)
📝 `backend/apps/rag/main.py` (+108 -110)
📝 `backend/apps/rag/search/brave.py` (+2 -2)
📝 `backend/apps/rag/search/duckduckgo.py` (+2 -1)
📝 `backend/apps/rag/search/google_pse.py` (+2 -3)
📝 `backend/apps/rag/search/jina_search.py` (+3 -3)
📝 `backend/apps/rag/search/main.py` (+3 -1)
➕ `backend/apps/rag/search/searchapi.py` (+49 -0)
📝 `backend/apps/rag/search/searxng.py` (+2 -3)
📝 `backend/apps/rag/search/serper.py` (+2 -2)
📝 `backend/apps/rag/search/serply.py` (+2 -3)
📝 `backend/apps/rag/search/serpstack.py` (+2 -3)
📝 `backend/apps/rag/search/tavily.py` (+1 -2)
➕ `backend/apps/rag/search/testdata/searchapi.json` (+383 -0)
_...and 66 more files_
</details>
### 📄 Description
# Pull Request Checklist
### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request.
https://github.com/open-webui/open-webui/discussions/5120
# Changelog Entry
### Description
This pull request introduces a new user role, "**content admin**," and updates the system to accommodate this role. The "**content admin**" role has specific permissions, including the ability to manage documents.
### Added
- New User Role: Introduced the "content admin" role with specific permissions to manage documents within the environment. (**purple** button)
### Changed
- **backend**:
- `backend/apps/webui/routers/auths.py`: Updated role handling logic to include "content admin" in configuration.
- `backend/apps/webui/routers/chats.py`: Adjusted chat access permissions to accommodate "content admin."
- `backend/apps/webui/routers/documents.py`: Modified API endpoints to manage document access and permissions for the "content admin" role.
- `backend/test/apps/webui/routers/test_auths.py`: Updated test cases to reflect changes in role handling.
- `backend/utils/utils.py`: Introduced utility functions to support the new role and permissions.
- **frontend**:
- Updated various components to handle the new role.
- `src/lib/components/admin/AddUserModal.svelte`: Added support for selecting "content admin" role.
- `src/lib/components/admin/Settings/General.svelte`: Added "content admin" option in role selection dropdown.
- `src/lib/components/layout/Sidebar.svelte`: Updated sidebar to show content admin specific links and options.
- `src/routes/(app)/+layout.svelte`: Updated layout logic to include the new role in routing and access control.
- `src/routes/(app)/admin/+page.svelte`: Enhanced user role handling to include "content admin" in role-based views.
- `src/routes/(app)/workspace/+layout.svelte`: Improved layout to handle role-based access for "content admin."
### Deprecated
- N/A
### Removed
- N/A
### Fixed
- N/A
### Security
- N/A
### Breaking Changes
- **BREAKING CHANGE**: BREAKING CHANGE: The introduction of the "content admin" role requires updates to both backend and frontend components. Ensure that the new role is handled appropriately in all affected areas.
---
### Screenshots or Videos
https://github.com/user-attachments/assets/62b9fed2-b570-41b4-b1b9-1b87665014db
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/5121
Author: @MarcRevo
Created: 9/3/2024
Status: ❌ Closed
Base:
main← Head:dev-content-admin📝 Commits (10+)
8994728Update translation.json6589450Merge pull request #4954 from open-webui/main0525dd2feat: support Literal type in Tools30e03cbAdd robots.txt to fix validation error718d69bAdd meta description22117e0A11y: Buttons do not have an accessible name7e1923fAdd searchapi as an alternative web searchfd16129Update color theme on system change2706b8ci18n: Update Catalan translation.jsona7b6d55i18n: Update Catalan translation.json📊 Changes
86 files changed (+1217 additions, -1071 deletions)
View changed files
📝
.github/workflows/release-pypi.yml(+1 -0)📝
README.md(+1 -1)📝
backend/apps/audio/main.py(+19 -32)📝
backend/apps/images/main.py(+23 -35)📝
backend/apps/images/utils/comfyui.py(+27 -12)📝
backend/apps/ollama/main.py(+19 -33)📝
backend/apps/openai/main.py(+21 -29)📝
backend/apps/rag/main.py(+108 -110)📝
backend/apps/rag/search/brave.py(+2 -2)📝
backend/apps/rag/search/duckduckgo.py(+2 -1)📝
backend/apps/rag/search/google_pse.py(+2 -3)📝
backend/apps/rag/search/jina_search.py(+3 -3)📝
backend/apps/rag/search/main.py(+3 -1)➕
backend/apps/rag/search/searchapi.py(+49 -0)📝
backend/apps/rag/search/searxng.py(+2 -3)📝
backend/apps/rag/search/serper.py(+2 -2)📝
backend/apps/rag/search/serply.py(+2 -3)📝
backend/apps/rag/search/serpstack.py(+2 -3)📝
backend/apps/rag/search/tavily.py(+1 -2)➕
backend/apps/rag/search/testdata/searchapi.json(+383 -0)...and 66 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.
https://github.com/open-webui/open-webui/discussions/5120
Changelog Entry
Description
This pull request introduces a new user role, "content admin," and updates the system to accommodate this role. The "content admin" role has specific permissions, including the ability to manage documents.
Added
Changed
backend/apps/webui/routers/auths.py: Updated role handling logic to include "content admin" in configuration.backend/apps/webui/routers/chats.py: Adjusted chat access permissions to accommodate "content admin."backend/apps/webui/routers/documents.py: Modified API endpoints to manage document access and permissions for the "content admin" role.backend/test/apps/webui/routers/test_auths.py: Updated test cases to reflect changes in role handling.backend/utils/utils.py: Introduced utility functions to support the new role and permissions.-
src/lib/components/admin/AddUserModal.svelte: Added support for selecting "content admin" role.-
src/lib/components/admin/Settings/General.svelte: Added "content admin" option in role selection dropdown.-
src/lib/components/layout/Sidebar.svelte: Updated sidebar to show content admin specific links and options.-
src/routes/(app)/+layout.svelte: Updated layout logic to include the new role in routing and access control.-
src/routes/(app)/admin/+page.svelte: Enhanced user role handling to include "content admin" in role-based views.-
src/routes/(app)/workspace/+layout.svelte: Improved layout to handle role-based access for "content admin."Deprecated
Removed
Fixed
Security
Breaking Changes
Screenshots or Videos
https://github.com/user-attachments/assets/62b9fed2-b570-41b4-b1b9-1b87665014db
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.