check permission list เมนูทะเบียนประวัติ
This commit is contained in:
parent
51707646e7
commit
6f2af7bb77
3 changed files with 82 additions and 11 deletions
|
|
@ -18,3 +18,27 @@ export function checkPermission(route: any): RoleData | null {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function checkPermissionCreate(sys: string) {
|
||||
if (storeMenu.permissions && sys) {
|
||||
return (
|
||||
storeMenu.permissions.roles.find(
|
||||
(item) => item.authSysId === sys && item.attrIsCreate
|
||||
) ?? false
|
||||
);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export function checkPermissionList(sys: string[]) {
|
||||
if (storeMenu.permissions && sys) {
|
||||
return (
|
||||
storeMenu.permissions.roles.some(
|
||||
(item) => sys.includes(item.authSysId) && item.attrIsCreate
|
||||
) ?? false
|
||||
);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue