fix frontend acl
This commit is contained in:
@@ -156,7 +156,7 @@ Espo.define('acl-manager', ['acl'], function (Acl) {
|
||||
},
|
||||
|
||||
checkInTeam: function (model) {
|
||||
return this.getImplementation(model.name).checkIsOwner(model);
|
||||
return this.getImplementation(model.name).checkInTeam(model);
|
||||
},
|
||||
|
||||
checkAssignmentPermission: function (user) {
|
||||
|
||||
+13
-2
@@ -170,14 +170,24 @@ Espo.define('acl', [], function () {
|
||||
},
|
||||
|
||||
checkIsOwner: function (model) {
|
||||
var result = false;
|
||||
|
||||
if (model.hasField('assignedUser')) {
|
||||
if (this.getUser().id === model.get('assignedUserId')) {
|
||||
return true;
|
||||
} else {
|
||||
if (!model.has('assignedUserId')) {
|
||||
result = null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (model.hasField('createdBy')) {
|
||||
if (this.getUser().id === model.get('createdById')) {
|
||||
return true;
|
||||
} else {
|
||||
if (!model.has('createdById')) {
|
||||
result = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,10 +199,12 @@ Espo.define('acl', [], function () {
|
||||
|
||||
if (~(model.get('assignedUsersIds') || []).indexOf(this.getUser().id)) {
|
||||
return true;
|
||||
} else {
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return result;
|
||||
},
|
||||
|
||||
checkInTeam: function (model) {
|
||||
@@ -220,4 +232,3 @@ Espo.define('acl', [], function () {
|
||||
|
||||
return Acl;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user