refactor: sub-table acl ignore (#2259)
This commit is contained in:
parent
137e3eb171
commit
1f8e0284fb
@ -233,7 +233,10 @@ export const useACLFieldWhitelist = () => {
|
|||||||
.concat(params?.appends || []);
|
.concat(params?.appends || []);
|
||||||
return {
|
return {
|
||||||
whitelist,
|
whitelist,
|
||||||
schemaInWhitelist(fieldSchema: Schema) {
|
schemaInWhitelist(fieldSchema: Schema, isSkip?) {
|
||||||
|
if (isSkip) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (whitelist.length === 0) {
|
if (whitelist.length === 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -97,6 +97,7 @@ export const SubTable: any = observer(
|
|||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
isSubTable={true}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -37,7 +37,7 @@ const useTableColumns = (props) => {
|
|||||||
const { exists, render } = useSchemaInitializer(schema['x-initializer']);
|
const { exists, render } = useSchemaInitializer(schema['x-initializer']);
|
||||||
const columns = schema
|
const columns = schema
|
||||||
.reduceProperties((buf, s) => {
|
.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.concat([s]);
|
||||||
}
|
}
|
||||||
return buf;
|
return buf;
|
||||||
|
Loading…
Reference in New Issue
Block a user