Skip to content

Commit dc608b3

Browse files
committed
feat: Restrict dashboard access to the super_admin role only.
1 parent e16df39 commit dc608b3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/auth/RequireAuth.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const RequireAuth = ({ children }) => {
1616
return <Navigate to="/login" state={{ from: location }} replace />;
1717
}
1818

19-
const allowedRoles = ['super_admin', 'admin', 'staff'];
19+
const allowedRoles = ['super_admin'];
2020

2121
if (!allowedRoles.includes(user.role)) {
2222
return (
@@ -26,7 +26,7 @@ const RequireAuth = ({ children }) => {
2626
<p className="text-slate-600 dark:text-slate-400 mb-6">
2727
You do not have permission to access the Dashboard.
2828
<br />
29-
<span className="text-xs mt-2 block">Required Role: Admin or Staff</span>
29+
<span className="text-xs mt-2 block">Required Role: Super Admin</span>
3030
<span className="text-xs block">Current Role: <span className="font-mono bg-slate-100 dark:bg-slate-700 px-2 py-0.5 rounded text-sm">{user.role}</span></span>
3131
</p>
3232
<button

0 commit comments

Comments
 (0)