diff --git a/db/versions/11227-maroonEucalyptus/00-addWorkerTimeControlMailAcl.sql b/db/versions/11227-maroonEucalyptus/00-addWorkerTimeControlMailAcl.sql new file mode 100644 index 000000000..330dcb839 --- /dev/null +++ b/db/versions/11227-maroonEucalyptus/00-addWorkerTimeControlMailAcl.sql @@ -0,0 +1,4 @@ +-- Place your SQL code here +INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId) + VALUES ('WorkerTimeControlMail', 'count', 'READ', 'ALLOW', 'ROLE', 'employee'), + ('Worker', '__get__mail', 'READ', 'ALLOW', 'ROLE', 'hr'); diff --git a/modules/worker/back/models/worker-time-control-mail.json b/modules/worker/back/models/worker-time-control-mail.json index 87eae9217..192178c2d 100644 --- a/modules/worker/back/models/worker-time-control-mail.json +++ b/modules/worker/back/models/worker-time-control-mail.json @@ -32,13 +32,5 @@ "sendedCounter": { "type": "number" } - }, - "acls": [ - { - "accessType": "READ", - "principalType": "ROLE", - "principalId": "employee", - "permission": "ALLOW" - } - ] -} + } +} \ No newline at end of file diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 82cd1cc2d..21c5bd10f 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -130,6 +130,11 @@ "type": "hasMany", "model": "TrainingCourse", "foreignKey": "workerFk" + }, + "mail": { + "type": "hasMany", + "model": "WorkerTimeControlMail", + "foreignKey": "workerFk" } }, "acls": [ @@ -139,6 +144,13 @@ "permission": "ALLOW", "principalType": "ROLE", "principalId": "$owner" + }, + { + "property": "__get__mail", + "accessType": "READ", + "permission": "ALLOW", + "principalType": "ROLE", + "principalId": "$owner" } ], "scopes": {