bootsaas logo

PermissionGuard

PermissionGuard is similar to RoleAware, it accepts a parameter 'rolesAllowd' but it doesn't wrap an element, it just shows a permission denied text.

It is useful on pages that are protected by roles, if the user directly accessed the route via url, then it this can be used in combination with RoleAware to both hide the content of the page and show a permission denied message.

For example:

<PermissionGuard rolesAllowed={[Role.ORG_ADMIN]} /> <RoleAware rolesAllowed={[Role.ORG_ADMIN]}> <PageTitle title="Organization invites" /> <NewInviteForm /> <InvitesTable className="mt-4"/> </RoleAware>
PermissionGuard
bootsaas logoCopyright © 2024 - All rights reserved