diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte
index 6b739f0e7..392a9e732 100644
--- a/src/lib/components/layout/Sidebar.svelte
+++ b/src/lib/components/layout/Sidebar.svelte
@@ -470,42 +470,44 @@
-
{#if $temporaryChatEnabled}
diff --git a/src/routes/(app)/workspace/+layout.svelte b/src/routes/(app)/workspace/+layout.svelte
index decce4fdd..856247252 100644
--- a/src/routes/(app)/workspace/+layout.svelte
+++ b/src/routes/(app)/workspace/+layout.svelte
@@ -12,6 +12,7 @@
tools
} from '$lib/stores';
import { page } from '$app/stores';
+ import { goto } from '$app/navigation';
import MenuLines from '$lib/components/icons/MenuLines.svelte';
@@ -20,6 +21,24 @@
let loaded = false;
onMount(async () => {
+ if ($user?.role !== 'admin') {
+ if ($page.url.pathname.includes('/models') && !$user?.permissions?.workspace?.models) {
+ goto('/');
+ } else if (
+ $page.url.pathname.includes('/knowledge') &&
+ !$user?.permissions?.workspace?.knowledge
+ ) {
+ goto('/');
+ } else if (
+ $page.url.pathname.includes('/prompts') &&
+ !$user?.permissions?.workspace?.prompts
+ ) {
+ goto('/');
+ } else if ($page.url.pathname.includes('/tools') && !$user?.permissions?.workspace?.tools) {
+ goto('/');
+ }
+ }
+
loaded = true;
});
@@ -57,39 +76,51 @@