diff --git a/packages/core/client/src/acl/ACLProvider.tsx b/packages/core/client/src/acl/ACLProvider.tsx index 0a8f685ca9..c7266ef8ee 100644 --- a/packages/core/client/src/acl/ACLProvider.tsx +++ b/packages/core/client/src/acl/ACLProvider.tsx @@ -297,7 +297,7 @@ export const useACLFieldWhitelist = () => { return { whitelist, schemaInWhitelist: useCallback( - (fieldSchema: Schema, isSkip?) => { + (fieldSchema: Schema | any, isSkip?) => { if (isSkip) { return true; } @@ -311,7 +311,8 @@ export const useACLFieldWhitelist = () => { return true; } const [key1, key2] = fieldSchema['x-collection-field'].split('.'); - return whitelist?.includes(key2 || key1); + const [associationField] = fieldSchema['name'].split('.'); + return whitelist?.includes(associationField || key2 || key1); }, [whitelist], ),