How to handle client permissions
USER
, PROJECT
, and NONE_RESOURCE
.
permission.helper.ts
): Provides utility functions to work with client roles, such as checking if an alias exists in the permission array of a given token role and filtering client roles by membership.
checkIfAliasIsInTokenRoles
filterClientRolesByMembership
projectRoles
, userRoles
, and noneResourceRoles
.fetchAndSetClientRoles
checkIfUserHasPermission
SidebarNavigationItem
checks if the user has the required permission (defined by permissionAlias
) before rendering the navigation item. This approach ensures that only authorized users can see and interact with specific navigation options.