fix: issue with ACLCollectionFieldProvider field permission evaluation (#4989)

This commit is contained in:
Katherine 2024-08-06 13:33:42 +08:00 committed by GitHub
parent 0d49c1ec55
commit 3813aaaf5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -313,7 +313,10 @@ export const ACLCollectionFieldProvider = (props) => {
const { allowAll } = useACLRoleContext();
const { whitelist } = useACLFieldWhitelist();
const [name] = (fieldSchema.name as string).split('.');
const allowed = !fieldSchema['x-acl-ignore'] && whitelist.length > 0 ? whitelist.includes(name) : true;
const allowed =
!fieldSchema['x-acl-ignore'] && whitelist.length > 0 && fieldSchema?.['x-collection-field']
? whitelist.includes(name)
: true;
useEffect(() => {
if (!allowed) {
field.required = false;