From 733e1ff60b0fe52e1820df6bcfa8dd9f0ae88ecf Mon Sep 17 00:00:00 2001 From: chenos Date: Tue, 31 Jan 2023 15:54:41 +0800 Subject: [PATCH] fix: acl field whitelist --- packages/core/client/src/acl/ACLProvider.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/client/src/acl/ACLProvider.tsx b/packages/core/client/src/acl/ACLProvider.tsx index c129d2e19..690528db9 100644 --- a/packages/core/client/src/acl/ACLProvider.tsx +++ b/packages/core/client/src/acl/ACLProvider.tsx @@ -244,8 +244,8 @@ export const useACLFieldWhitelist = () => { if (!fieldSchema['x-collection-field']) { return true; } - const [, ...keys] = fieldSchema['x-collection-field'].split('.'); - return whitelist?.includes(keys.join('.')); + const [key1, key2] = fieldSchema['x-collection-field'].split('.'); + return whitelist?.includes(key2 || key1); }, }; };