diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py
index 83efa89fa..4362eae0b 100644
--- a/backend/open_webui/config.py
+++ b/backend/open_webui/config.py
@@ -739,12 +739,12 @@ DEFAULT_USER_ROLE = PersistentConfig(
os.getenv("DEFAULT_USER_ROLE", "pending"),
)
-USER_PERMISSIONS_CHAT_DELETION = (
- os.environ.get("USER_PERMISSIONS_CHAT_DELETION", "True").lower() == "true"
+USER_PERMISSIONS_CHAT_DELETE = (
+ os.environ.get("USER_PERMISSIONS_CHAT_DELETE", "True").lower() == "true"
)
-USER_PERMISSIONS_CHAT_EDITING = (
- os.environ.get("USER_PERMISSIONS_CHAT_EDITING", "True").lower() == "true"
+USER_PERMISSIONS_CHAT_EDIT = (
+ os.environ.get("USER_PERMISSIONS_CHAT_EDIT", "True").lower() == "true"
)
USER_PERMISSIONS_CHAT_TEMPORARY = (
@@ -753,11 +753,11 @@ USER_PERMISSIONS_CHAT_TEMPORARY = (
USER_PERMISSIONS = PersistentConfig(
"USER_PERMISSIONS",
- "ui.user_permissions",
+ "user.permissions",
{
"chat": {
- "deletion": USER_PERMISSIONS_CHAT_DELETION,
- "editing": USER_PERMISSIONS_CHAT_EDITING,
+ "deletion": USER_PERMISSIONS_CHAT_DELETE,
+ "editing": USER_PERMISSIONS_CHAT_EDIT,
"temporary": USER_PERMISSIONS_CHAT_TEMPORARY,
}
},
@@ -785,18 +785,6 @@ DEFAULT_ARENA_MODEL = {
},
}
-ENABLE_MODEL_FILTER = PersistentConfig(
- "ENABLE_MODEL_FILTER",
- "model_filter.enable",
- os.environ.get("ENABLE_MODEL_FILTER", "False").lower() == "true",
-)
-MODEL_FILTER_LIST = os.environ.get("MODEL_FILTER_LIST", "")
-MODEL_FILTER_LIST = PersistentConfig(
- "MODEL_FILTER_LIST",
- "model_filter.list",
- [model.strip() for model in MODEL_FILTER_LIST.split(";")],
-)
-
WEBHOOK_URL = PersistentConfig(
"WEBHOOK_URL", "webhook_url", os.environ.get("WEBHOOK_URL", "")
)
diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py
index 353a1198f..faef9e81c 100644
--- a/backend/open_webui/main.py
+++ b/backend/open_webui/main.py
@@ -70,13 +70,11 @@ from open_webui.config import (
DEFAULT_LOCALE,
ENABLE_ADMIN_CHAT_ACCESS,
ENABLE_ADMIN_EXPORT,
- ENABLE_MODEL_FILTER,
ENABLE_OLLAMA_API,
ENABLE_OPENAI_API,
ENABLE_TAGS_GENERATION,
ENV,
FRONTEND_BUILD_DIR,
- MODEL_FILTER_LIST,
OAUTH_PROVIDERS,
ENABLE_SEARCH_QUERY,
SEARCH_QUERY_GENERATION_PROMPT_TEMPLATE,
@@ -194,9 +192,6 @@ app.state.config = AppConfig()
app.state.config.ENABLE_OPENAI_API = ENABLE_OPENAI_API
app.state.config.ENABLE_OLLAMA_API = ENABLE_OLLAMA_API
-app.state.config.ENABLE_MODEL_FILTER = ENABLE_MODEL_FILTER
-app.state.config.MODEL_FILTER_LIST = MODEL_FILTER_LIST
-
app.state.config.WEBHOOK_URL = WEBHOOK_URL
app.state.config.TASK_MODEL = TASK_MODEL
diff --git a/src/lib/components/admin/Users/Groups.svelte b/src/lib/components/admin/Users/Groups.svelte
index 7e3977755..ff78169b3 100644
--- a/src/lib/components/admin/Users/Groups.svelte
+++ b/src/lib/components/admin/Users/Groups.svelte
@@ -48,69 +48,38 @@
let showCreateGroupModal = false;
let showDefaultPermissionsModal = false;
+ const setGroups = async () => {
+ groups = await getGroups(localStorage.token);
+ };
+
+ const addGroupHandler = async (group) => {
+ const res = await createNewGroup(localStorage.token, group).catch((error) => {
+ toast.error(error);
+ return null;
+ });
+
+ if (res) {
+ toast.success($i18n.t('Group created successfully'));
+ groups = await getGroups(localStorage.token);
+ }
+ };
+
+ const updateDefaultPermissionsHandler = async (permissions) => {
+ console.log(permissions);
+ };
+
onMount(async () => {
if ($user?.role !== 'admin') {
await goto('/');
} else {
- groups = await getGroups(localStorage.token);
-
- // [
- // {
- // id: '1',
- // name: 'Group A',
- // description: 'Group A description',
- // permissions: {
- // model: {
- // enable_filter: false, // boolean
- // ids: [], // array of strings
- // default_id: null // null or string
- // },
- // workspace: {
- // models: false, // boolean
- // knowledge: false, // boolean
- // prompts: false // boolean
- // },
- // chat: {
- // delete: true, // boolean
- // edit: true, // boolean
- // temporary: true // boolean
- // }
- // },
- // user_ids: ['1', '2', '3'], // array of strings
- // admin_ids: ['1'] // array of strings
- // },
- // {
- // id: '2',
- // name: 'Moderators',
- // description: 'Moderators description',
- // permissions: {
- // model: {
- // enable_filter: false, // boolean
- // ids: [], // array of strings
- // default_id: null // null or string
- // },
- // workspace: {
- // models: false, // boolean
- // knowledge: false, // boolean
- // prompts: false // boolean
- // },
- // chat: {
- // delete: true, // boolean
- // edit: true, // boolean
- // temporary: true // boolean
- // }
- // },
- // user_ids: ['1', '5', '6'], // array of strings
- // admin_ids: ['1'] // array of strings
- // }
- // ];
+ await setGroups();
}
loaded = true;
});
{#if loaded}
-