From 7ca3ea156cc1937564056c350da526fc121f7d4d Mon Sep 17 00:00:00 2001 From: pablone Date: Mon, 6 Nov 2023 09:16:10 +0100 Subject: [PATCH] feat(claimViewer): refs #5881 nuevo rol claimViewer --- db/changes/234601/00-claimViewweAcl.sql | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 db/changes/234601/00-claimViewweAcl.sql diff --git a/db/changes/234601/00-claimViewweAcl.sql b/db/changes/234601/00-claimViewweAcl.sql new file mode 100644 index 000000000..e913c0ed9 --- /dev/null +++ b/db/changes/234601/00-claimViewweAcl.sql @@ -0,0 +1,31 @@ +INSERT INTO `account`.`role` (`name`, `description`, `hasLogin`) + VALUES ('claimViewer','Trabajadores que consulta las reclamaciones ',1); + +INSERT INTO `account`.`roleInherit` (`role`,`inheritsFrom`) + SELECT `r`.`id`, `r2`.`id` + FROM `account`.`role` `r` + JOIN `account`.`role` `r2` ON `r2`.`name` = 'claimViewer' + WHERE `r`.`name` IN ( + 'salesPerson', + 'buyer', + 'deliveryBoss', + 'handmadeBoss' + ); + +DELETE FROM `salix`.`ACL` + WHERE `model`= 'claim' + AND `property` IN ( + 'filter', + 'find', + 'findById', + 'getSummary' + ); + +INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalid`) + VALUES ('Claim','filter','READ','ALLOW','ROLE','claimViewer'); +INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalid`) + VALUES ('Claim','find','READ','ALLOW','ROLE','claimViewer'); +INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalid`) + VALUES ('Claim','findById','READ','ALLOW','ROLE','claimViewer'); +INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalid`) + VALUES ('Claim','getSummary','READ','ALLOW','ROLE','claimViewer'); \ No newline at end of file