The component to check user permission roles.


This component checks whether the current user has permissions in the permissions prop. It is designed to be used with the <Route /> component as the parent route of nested routes. For example, the code below will make the nested route only accessible for the access permission role.

<Route element={<PermissionRouter permissions={["access"]} />} >
	<Route exact path={pathnames.Subscription+"/"} element={<div>Home</div>} />


Prop NameDescription
permissionsThis is an array of the permission roles that are allowed for the route.

Source Code