From 4a3dc5d658db999d4e56fb04aa502ac73fa02061 Mon Sep 17 00:00:00 2001 From: Dejan Zdravkovic Date: Sat, 6 Jan 2024 22:19:04 +0100 Subject: [PATCH] svelte - isAdmin --- frontend/svelte-kit/src/lib/components/user-navbar.svelte | 5 +---- frontend/svelte-kit/src/lib/server/utils/util.ts | 7 +++++++ frontend/svelte-kit/src/routes/+layout.server.ts | 7 ++++--- frontend/svelte-kit/src/routes/+layout.svelte | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/frontend/svelte-kit/src/lib/components/user-navbar.svelte b/frontend/svelte-kit/src/lib/components/user-navbar.svelte index 11d244a6..8afe664d 100644 --- a/frontend/svelte-kit/src/lib/components/user-navbar.svelte +++ b/frontend/svelte-kit/src/lib/components/user-navbar.svelte @@ -7,11 +7,8 @@ import SunIcon from '$lib/icons/sun.svelte'; import avatar from '$lib/images/avatar.jpg'; import logo from '$lib/images/logo.png'; - // import { RoleName } from '$lib/models/user/role'; - // import { userStore } from '$lib/stores/user'; - // $: isAdmin = $userStore?.roles.some((role) => role.name === RoleName.ADMIN); - $: isAdmin = true; + export let isAdmin: boolean;