Browse Source

chore(gui-v2): remove unnecessary typecast

pull/2940/head
braks 2 years ago
parent
commit
f9d8389cec
  1. 6
      packages/nc-gui-v2/composables/useUIPermission/index.ts

6
packages/nc-gui-v2/composables/useUIPermission/index.ts

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

Loading…
Cancel
Save