|
|
@ -35,11 +35,7 @@ export function useUIPermission() { |
|
|
|
return Object.entries<boolean>(roles).some(([role, hasRole]) => { |
|
|
|
return Object.entries<boolean>(roles).some(([role, hasRole]) => { |
|
|
|
const rolePermission = rolePermissions[role as keyof typeof rolePermissions] as Permission |
|
|
|
const rolePermission = rolePermissions[role as keyof typeof rolePermissions] as Permission |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return hasRole && (rolePermission === '*' || (typeof rolePermission === 'object' && rolePermission[permission])) |
|
|
|
hasRole && |
|
|
|
|
|
|
|
(rolePermission === '*' || |
|
|
|
|
|
|
|
(typeof rolePermission === 'object' && rolePermission[permission as keyof typeof rolePermission])) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|