mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 05:45:19 +00:00
fix: user workspace behaviour
This commit is contained in:
parent
e65ec1c6cc
commit
892f6ba42b
1 changed files with 16 additions and 1 deletions
|
|
@ -1,8 +1,23 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
|
import { user } from '$lib/stores';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
goto('/workspace/models');
|
if ($user?.role !== 'admin') {
|
||||||
|
if ($user?.permissions?.workspace?.models) {
|
||||||
|
goto('/workspace/models');
|
||||||
|
} else if ($user?.permissions?.workspace?.knowledge) {
|
||||||
|
goto('/workspace/knowledge');
|
||||||
|
} else if ($user?.permissions?.workspace?.prompts) {
|
||||||
|
goto('/workspace/prompts');
|
||||||
|
} else if ($user?.permissions?.workspace?.tools) {
|
||||||
|
goto('/workspace/tools');
|
||||||
|
} else {
|
||||||
|
goto('/');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
goto('/workspace/models');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue