mirror of
https://github.com/steedos/steedos-platform
synced 2024-11-22 00:01:52 +00:00
Update object.ts
This commit is contained in:
parent
d6184f1883
commit
345f8b0392
@ -1110,20 +1110,22 @@ export class SteedosObjectType extends SteedosObjectProperties {
|
||||
const userObjectFields = objectConfig.fields;
|
||||
_.each(objectConfig.permissions.field_permissions, (field_permission, field) => {
|
||||
const { read, edit } = field_permission;
|
||||
if (read) {
|
||||
userObjectFields[field].hidden = false;
|
||||
userObjectFields[field].omit = true;
|
||||
userObjectFields[field].readonly = true;
|
||||
userObjectFields[field].disabled = true;
|
||||
}
|
||||
if (edit) {
|
||||
userObjectFields[field].omit = false;
|
||||
userObjectFields[field].hidden = false;
|
||||
userObjectFields[field].readonly = false;
|
||||
userObjectFields[field].disabled = false;
|
||||
}
|
||||
if (!read && !edit) {
|
||||
delete userObjectFields[field]
|
||||
if (userObjectFields[field]) {
|
||||
if (read) {
|
||||
userObjectFields[field].hidden = false;
|
||||
userObjectFields[field].omit = true;
|
||||
userObjectFields[field].readonly = true;
|
||||
userObjectFields[field].disabled = true;
|
||||
}
|
||||
if (edit) {
|
||||
userObjectFields[field].omit = false;
|
||||
userObjectFields[field].hidden = false;
|
||||
userObjectFields[field].readonly = false;
|
||||
userObjectFields[field].disabled = false;
|
||||
}
|
||||
if (!read && !edit) {
|
||||
delete userObjectFields[field]
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user