diff --git a/db/changes/10440-fallas/00-aclAgency.sql b/db/changes/10440-fallas/00-aclAgency.sql index 8073ee69c..9e5bb6382 100644 --- a/db/changes/10440-fallas/00-aclAgency.sql +++ b/db/changes/10440-fallas/00-aclAgency.sql @@ -1,2 +1,2 @@ -INSERT INTO salix.ACL (id, model, property, accessType, permission, principalType, principalId) +INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES(304, 'Agency', '*', '*', 'ALLOW', 'ROLE', 'employee'); diff --git a/db/changes/10440-fallas/00-aclSupplierAgencyTerms.sql b/db/changes/10440-fallas/00-aclSupplierAgencyTerms.sql index a762f0e64..fa57c1d64 100644 --- a/db/changes/10440-fallas/00-aclSupplierAgencyTerms.sql +++ b/db/changes/10440-fallas/00-aclSupplierAgencyTerms.sql @@ -1,3 +1,3 @@ -INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId) +INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('SupplierAgencyTerm', '*', '*', 'ALLOW', 'ROLE', 'administrative'); diff --git a/db/changes/10440-fallas/00-supplierAgencyTerm.sql b/db/changes/10440-fallas/00-supplierAgencyTerm.sql index 4a976b83d..f8539f607 100644 --- a/db/changes/10440-fallas/00-supplierAgencyTerm.sql +++ b/db/changes/10440-fallas/00-supplierAgencyTerm.sql @@ -1,14 +1,14 @@ -ALTER TABLE vn.agencyTerm ADD supplierFk INT NULL; -ALTER TABLE vn.agencyTerm CHANGE supplierFk supplierFk INT NULL AFTER agencyFk; +ALTER TABLE `vn`.`agencyTerm` ADD `supplierFk` INT NULL; +ALTER TABLE `vn`.`agencyTerm` CHANGE `supplierFk` `supplierFk` INT NULL AFTER `agencyFk`; -UPDATE vn.agencyTerm `at` - JOIN vn.agency a ON a.id = `at`.agencyFk -SET `at`.supplierFk = a.supplierFk; +UPDATE `vn`.`agencyTerm` `at` + JOIN `vn`.`agency` `a` ON `a`.`id` = `at`.`agencyFk` +SET `at`.`supplierFk` = `a`.`supplierFk`; -ALTER TABLE vn.agencyTerm ADD CONSTRAINT agencyTerm_FK FOREIGN KEY (agencyFk) REFERENCES vn.agency(id) ON DELETE RESTRICT ON UPDATE CASCADE; -ALTER TABLE vn.agencyTerm ADD CONSTRAINT agencyTerm_FK_1 FOREIGN KEY (supplierFk) REFERENCES vn.supplier(id) ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE `vn`.`agencyTerm` ADD CONSTRAINT `agencyTerm_FK` FOREIGN KEY (`agencyFk`) REFERENCES `vn`.`agency`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE `vn`.`agencyTerm` ADD CONSTRAINT `agencyTerm_FK_1` FOREIGN KEY (`supplierFk`) REFERENCES `vn`.`supplier`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; -RENAME TABLE vn.agencyTerm TO vn.supplierAgencyTerm; +RENAME TABLE `vn`.`agencyTerm` TO `vn`.`supplierAgencyTerm`; CREATE OR REPLACE ALGORITHM = UNDEFINED @@ -26,8 +26,8 @@ SELECT FROM `vn`.`supplierAgencyTerm` `sat`; -ALTER TABLE vn.agency DROP FOREIGN KEY agency_ibfk_4; -ALTER TABLE vn.agency CHANGE supplierFk supplierFk__ int(11) DEFAULT NULL NULL; +ALTER TABLE `vn`.`agency` DROP FOREIGN KEY `agency_ibfk_4`; +ALTER TABLE `vn`.`agency` CHANGE `supplierFk` `supplierFk__` int(11) DEFAULT NULL NULL; CREATE OR REPLACE ALGORITHM = UNDEFINED diff --git a/modules/supplier/back/models/supplier-agency-term.js b/modules/supplier/back/models/supplier-agency-term.js index 93cee928b..961413c18 100644 --- a/modules/supplier/back/models/supplier-agency-term.js +++ b/modules/supplier/back/models/supplier-agency-term.js @@ -1,4 +1,4 @@ -let UserError = require('vn-loopback/util/user-error'); +const UserError = require('vn-loopback/util/user-error'); module.exports = Self => { Self.rewriteDbError(function(err) { diff --git a/modules/supplier/back/models/supplier-agency-term.json b/modules/supplier/back/models/supplier-agency-term.json index 0cd7a0891..f9c39729a 100644 --- a/modules/supplier/back/models/supplier-agency-term.json +++ b/modules/supplier/back/models/supplier-agency-term.json @@ -42,13 +42,5 @@ "model": "Agency", "foreignKey": "agencyFk" } - }, - "acls": [ - { - "accessType": "EXECUTE", - "principalType": "ROLE", - "principalId": "$everyone", - "permission": "ALLOW" - } - ] + } } \ No newline at end of file diff --git a/modules/supplier/front/routes.json b/modules/supplier/front/routes.json index 39445e5a1..35519b89a 100644 --- a/modules/supplier/front/routes.json +++ b/modules/supplier/front/routes.json @@ -94,7 +94,7 @@ "abstract": true }, { - "url": "/index?q", + "url": "/index", "state": "supplier.card.agencyTerm.index", "component": "vn-supplier-agency-term-index", "description": "Autonomous",