Browse Source

Update index.ts

pull/2860/head
Pranav C 2 years ago committed by GitHub
parent
commit
dcd5fba24e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nc-gui-v2/composables/useUIPermission/index.ts

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

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

Loading…
Cancel
Save