Role-Based Access Control Demo
This page demonstrates the role-based access control system. Check your profile to see your current roles and permissions.
Role-Based Access Control Examples
Using useRoles Hook
Your sections: None
Admin sections: None
Is any admin: No
Using useSectionAccess Hook
E-Games Section
Has access: No
Is admin: No
Can view: No
Can edit: No
Can manage: No
Classic Games Section
Has access: No
Is admin: No
Can view: No
Can edit: No
Can manage: No
Using RoleGuard Components
You don't have access to E-Games
You are not an admin of E-Games
You cannot manage E-Games
Usage Examples
1. Using hooks in components:
const { sections, canManage } = useRoles()
const eGamesAccess = useSectionAccess('ie-club-e-games')
if (eGamesAccess.canManage) {
// Show admin controls
}2. Using RoleGuard components:
<RoleGuard section="ie-club-e-games"> <AdminPanel /> </RoleGuard> <PermissionGuard section="ie-club-e-games" permission="canEdit"> <EditButton /> </PermissionGuard>