From 7f5224ebcabe7c504ac67123aed95e5b079877fd Mon Sep 17 00:00:00 2001 From: jtubau Date: Tue, 21 Jan 2025 14:45:13 +0100 Subject: [PATCH] feat: refs #8304 add ACL entries for Business and Worker models and update worker model relationships --- db/versions/11404-azureAnthurium/00-firstScript.sql | 6 +++++- modules/worker/back/models/worker.json | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/db/versions/11404-azureAnthurium/00-firstScript.sql b/db/versions/11404-azureAnthurium/00-firstScript.sql index 7a4dfe9bc..58e74cbfb 100644 --- a/db/versions/11404-azureAnthurium/00-firstScript.sql +++ b/db/versions/11404-azureAnthurium/00-firstScript.sql @@ -1,2 +1,6 @@ INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId) -VALUES('WorkerDms', 'hasHighPrivs', 'READ', 'ALLOW', 'ROLE', 'hr'); \ No newline at end of file +VALUES + ('WorkerDms', 'hasHighPrivs', 'READ', 'ALLOW', 'ROLE', 'hr'), + ('Business', 'updateAttributes', 'WRITE', 'ALLOW', 'ROLE', 'hr'), + ('Worker', '__get__business', 'READ', 'ALLOW', 'ROLE', 'hr') + ; \ No newline at end of file diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 705851963..fbba4c227 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -142,6 +142,11 @@ "type": "hasMany", "model": "WorkerRelative", "foreignKey": "workerFK" + }, + "business": { + "type": "hasMany", + "model": "Business", + "foreignKey": "workerFk" } }, "acls": [