Skip to content

Commit 32e4538

Browse files
authored
fix: Show configuration when allowedRolesForConfiguration is not set (#424)
Fix case when allowedRolesForConfiguration is an empty array, it should show the configuration modal
1 parent 20b68c7 commit 32e4538

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hooks/useAccessControl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const useAccessControl = (config: PluginConfig) => {
55
const user = useCurrentUser()
66

77
const hasConfigAccess =
8-
!config?.allowedRolesForConfiguration ||
8+
!config?.allowedRolesForConfiguration?.length ||
99
user?.roles?.some((role) => config.allowedRolesForConfiguration.includes(role.name))
1010

1111
return {hasConfigAccess}

0 commit comments

Comments
 (0)