From 4b48a89eaa4d8b0b07812e96b4b825591f86b4fc Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Thu, 13 Feb 2020 08:31:29 +0100 Subject: [PATCH] ticket descriptor update acl --- db/changes/10150-entry/00-acl.sql | 3 +++ e2e/paths/05-ticket/09_weekly.spec.js | 2 +- modules/ticket/front/descriptor/index.js | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 db/changes/10150-entry/00-acl.sql diff --git a/db/changes/10150-entry/00-acl.sql b/db/changes/10150-entry/00-acl.sql new file mode 100644 index 000000000..59934a266 --- /dev/null +++ b/db/changes/10150-entry/00-acl.sql @@ -0,0 +1,3 @@ +INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId) + VALUES ('TicketWeekly', '*', 'WRITE', 'ALLOW', 'ROLE', 'buyer'); +UPDATE salix.ACL SET accessType = 'READ' WHERE (id = '91'); \ No newline at end of file diff --git a/e2e/paths/05-ticket/09_weekly.spec.js b/e2e/paths/05-ticket/09_weekly.spec.js index c732a4b87..3e791dc18 100644 --- a/e2e/paths/05-ticket/09_weekly.spec.js +++ b/e2e/paths/05-ticket/09_weekly.spec.js @@ -8,7 +8,7 @@ describe('Ticket descriptor path', () => { beforeAll(async() => { browser = await getBrowser(); page = browser.page; - await page.loginAndModule('employee', 'ticket'); + await page.loginAndModule('buyer', 'ticket'); await page.accessToSection('ticket.weekly.index'); }); diff --git a/modules/ticket/front/descriptor/index.js b/modules/ticket/front/descriptor/index.js index ef64bf84e..10da4cca9 100644 --- a/modules/ticket/front/descriptor/index.js +++ b/modules/ticket/front/descriptor/index.js @@ -7,7 +7,11 @@ class Controller extends Component { this.aclService = aclService; this.$httpParamSerializer = $httpParamSerializer; this.moreOptions = [ - {name: 'Add turn', callback: this.showAddTurnDialog}, + { + name: 'Add turn', + acl: 'buyer', + callback: this.showAddTurnDialog + }, {name: 'Show Delivery Note', callback: this.showDeliveryNote}, {name: 'Send Delivery Note', callback: this.confirmDeliveryNote}, {name: 'Delete ticket', callback: this.showDeleteTicketDialog},