diff --git a/apps/dashboard/src/lib/components/RoleBasedSecurity/index.svelte b/apps/dashboard/src/lib/components/RoleBasedSecurity/index.svelte
index b3ced824..e6b7779b 100644
--- a/apps/dashboard/src/lib/components/RoleBasedSecurity/index.svelte
+++ b/apps/dashboard/src/lib/components/RoleBasedSecurity/index.svelte
@@ -3,13 +3,14 @@
import { group } from '../Course/store';
import type { GroupPerson } from '$lib/utils/types';
import { isOrgAdmin } from '$lib/utils/store/org';
- import { ROLE } from '$lib/utils/constants/roles';
- export let allowedRoles: number[] = [1, 2, 3];
+ export let allowedRoles: number[] = [];
export let onDenied = () => {};
+ // Since orgAdmin can see all, we need a way to show the content only to students
export let onlyStudent = false;
let userRole: number = 0;
+ let show = false;
function isAllowed(userRole) {
return allowedRoles.includes(userRole);
@@ -25,7 +26,11 @@
}
}
- $: show = onlyStudent ? isAllowed(ROLE.STUDENT) : isAllowed(userRole) || $isOrgAdmin;
+ $: if (onlyStudent) {
+ show = isAllowed(userRole);
+ } else {
+ show = isAllowed(userRole) || $isOrgAdmin;
+ }
{#if show}
diff --git a/apps/dashboard/src/routes/courses/[id]/certificates/+page.svelte b/apps/dashboard/src/routes/courses/[id]/certificates/+page.svelte
index c0b909d8..0303c9e0 100644
--- a/apps/dashboard/src/routes/courses/[id]/certificates/+page.svelte
+++ b/apps/dashboard/src/routes/courses/[id]/certificates/+page.svelte
@@ -36,7 +36,7 @@
-
+