Update object.ts

This commit is contained in:
baozhoutao 2022-01-21 14:17:42 +08:00
parent d6184f1883
commit 345f8b0392

View File

@ -1110,6 +1110,7 @@ export class SteedosObjectType extends SteedosObjectProperties {
const userObjectFields = objectConfig.fields;
_.each(objectConfig.permissions.field_permissions, (field_permission, field) => {
const { read, edit } = field_permission;
if (userObjectFields[field]) {
if (read) {
userObjectFields[field].hidden = false;
userObjectFields[field].omit = true;
@ -1125,6 +1126,7 @@ export class SteedosObjectType extends SteedosObjectProperties {
if (!read && !edit) {
delete userObjectFields[field]
}
}
})
objectConfig.fields = userObjectFields