chore: admin can access all components

This commit is contained in:
Rotimi Best
2024-07-08 06:52:23 +01:00
parent b60b45ed26
commit 6ad38429b0
@@ -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();
}
}