mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 08:26:21 +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 {
|
return {
|
||||||
whitelist,
|
whitelist,
|
||||||
schemaInWhitelist: useCallback(
|
schemaInWhitelist: useCallback(
|
||||||
(fieldSchema: Schema, isSkip?) => {
|
(fieldSchema: Schema | any, isSkip?) => {
|
||||||
if (isSkip) {
|
if (isSkip) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -311,7 +311,8 @@ export const useACLFieldWhitelist = () => {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const [key1, key2] = fieldSchema['x-collection-field'].split('.');
|
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],
|
[whitelist],
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user