refac
This commit is contained in:
@@ -163,8 +163,8 @@ def has_connection_access(
|
|||||||
based on ``config.access_grants`` within the connection dict.
|
based on ``config.access_grants`` within the connection dict.
|
||||||
|
|
||||||
- Admin with BYPASS_ADMIN_ACCESS_CONTROL → always allowed
|
- Admin with BYPASS_ADMIN_ACCESS_CONTROL → always allowed
|
||||||
- Empty / missing access_grants → allowed for all users
|
- Missing, None, or empty access_grants → private, admin-only
|
||||||
- Otherwise → delegates to ``has_access``
|
- access_grants has entries → delegates to ``has_access``
|
||||||
"""
|
"""
|
||||||
from open_webui.config import BYPASS_ADMIN_ACCESS_CONTROL
|
from open_webui.config import BYPASS_ADMIN_ACCESS_CONTROL
|
||||||
|
|
||||||
@@ -175,9 +175,6 @@ def has_connection_access(
|
|||||||
user_group_ids = {group.id for group in Groups.get_groups_by_member_id(user.id)}
|
user_group_ids = {group.id for group in Groups.get_groups_by_member_id(user.id)}
|
||||||
|
|
||||||
access_grants = (connection.get("config") or {}).get("access_grants", [])
|
access_grants = (connection.get("config") or {}).get("access_grants", [])
|
||||||
if not access_grants:
|
|
||||||
return True
|
|
||||||
|
|
||||||
return has_access(user.id, "read", access_grants, user_group_ids)
|
return has_access(user.id, "read", access_grants, user_group_ids)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "open-webui",
|
"name": "open-webui",
|
||||||
"version": "0.8.6",
|
"version": "0.8.7",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "open-webui",
|
"name": "open-webui",
|
||||||
"version": "0.8.6",
|
"version": "0.8.7",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/msal-browser": "^4.5.0",
|
"@azure/msal-browser": "^4.5.0",
|
||||||
"@codemirror/lang-javascript": "^6.2.2",
|
"@codemirror/lang-javascript": "^6.2.2",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "open-webui",
|
"name": "open-webui",
|
||||||
"version": "0.8.6",
|
"version": "0.8.7",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "npm run pyodide:fetch && vite dev --host",
|
"dev": "npm run pyodide:fetch && vite dev --host",
|
||||||
|
|||||||
Reference in New Issue
Block a user