react-rbac-simplified
Version:
A lightweight and flexible React component for role-based access control (RBAC). Easily manage user permissions and restrict access to components based on roles.
25 lines (24 loc) • 531 B
text/typescript
type RBAC_PROPS = {
WrapperElem: React.FC;
LoadingElem?: React.FC;
authData: {
hasToken: boolean;
roles: {
isAdmin: boolean;
isMaintainer: boolean;
isSuperAdmin?: boolean;
};
onUnauthorizedPageRequest: () => void;
routes: {
ADMIN_ROUTES: string[];
PROTECTED_ROUTES: string[];
SUPER_ADMIN_ROUTES?: string[];
AUTH_ROUTES: string[];
};
redirects: {
auth: string;
default: string;
superAdmin?: string;
};
};
};