mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 04:15:19 +00:00
fix: validate association field permissions when checking association collection field permissions (#5569)
This commit is contained in:
parent
a359ddef4c
commit
f8ca0da8b3
@ -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],
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user