From 6ad38429b041ed476e200c73fc009c553f0314ec Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Mon, 8 Jul 2024 06:52:23 +0100 Subject: [PATCH] chore: admin can access all components --- .../src/lib/components/RoleBasedSecurity/index.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/src/lib/components/RoleBasedSecurity/index.svelte b/apps/dashboard/src/lib/components/RoleBasedSecurity/index.svelte index 3d2c5dda..3b0c5045 100644 --- a/apps/dashboard/src/lib/components/RoleBasedSecurity/index.svelte +++ b/apps/dashboard/src/lib/components/RoleBasedSecurity/index.svelte @@ -2,6 +2,7 @@ import { profile } from '$lib/utils/store/user'; import { group } from '../Course/store'; import type { GroupPerson } from '$lib/utils/types'; + import { isOrgAdmin } from '$lib/utils/store/org'; export let allowedRoles: number[] = []; export let onDenied = () => {}; @@ -13,7 +14,7 @@ userRole = user ? user.role_id : userRole; - if ($group.people.length && !allowedRoles.includes(userRole)) { + if (!$isOrgAdmin && $group.people.length && !allowedRoles.includes(userRole)) { onDenied(); } }