mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 19:58:11 +00:00
fix ui
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { NavOptions } from "../navigation/navigationtabs";
|
||||
|
||||
export const hasAccess = (
|
||||
item: NavOptions,
|
||||
userPermissions: string[],
|
||||
userRoles: string[]
|
||||
): boolean => {
|
||||
const permsCheck =
|
||||
item.perms?.some((perm) => userPermissions.includes(perm)) ?? true;
|
||||
|
||||
const rolesCheck =
|
||||
item.roles?.some((role) => userRoles.includes(role)) ?? true;
|
||||
|
||||
return permsCheck || rolesCheck;
|
||||
};
|
||||
import { NavOptions } from "../navigation/navigationtabs";
|
||||
|
||||
export const hasAccess = (
|
||||
item: NavOptions,
|
||||
userPermissions: string[],
|
||||
userRoles: string[]
|
||||
): boolean => {
|
||||
const permsCheck =
|
||||
item.perms?.some((perm) => userPermissions.includes(perm)) ?? true;
|
||||
|
||||
const rolesCheck =
|
||||
item.roles?.some((role) => userRoles.includes(role)) ?? true;
|
||||
|
||||
return permsCheck || rolesCheck;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user