refactor: sub-table acl ignore (#2259)

This commit is contained in:
katherinehhh 2023-07-25 14:01:54 +08:00 committed by GitHub
parent 137e3eb171
commit 1f8e0284fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -233,7 +233,10 @@ export const useACLFieldWhitelist = () => {
.concat(params?.appends || []);
return {
whitelist,
schemaInWhitelist(fieldSchema: Schema) {
schemaInWhitelist(fieldSchema: Schema, isSkip?) {
if (isSkip) {
return true;
}
if (whitelist.length === 0) {
return true;
}

View File

@ -97,6 +97,7 @@ export const SubTable: any = observer(
</Button>
)
}
isSubTable={true}
/>
</div>
);

View File

@ -37,7 +37,7 @@ const useTableColumns = (props) => {
const { exists, render } = useSchemaInitializer(schema['x-initializer']);
const columns = schema
.reduceProperties((buf, s) => {
if (isColumnComponent(s) && schemaInWhitelist(Object.values(s.properties || {}).pop())) {
if (isColumnComponent(s) && schemaInWhitelist(Object.values(s.properties || {}).pop(), props?.isSubTable)) {
return buf.concat([s]);
}
return buf;