refs #7529 back models acls #2563

Merged
carlossa merged 19 commits from 7529-workerPIT into dev 2024-11-20 12:21:31 +00:00
2 changed files with 25 additions and 10 deletions
Showing only changes of commit 903d85a243 - Show all commits

View File

@ -1,15 +1,15 @@
ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_disabilityGradeFk; -- ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_disabilityGradeFk;
ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_workerFk; -- ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_workerFk;
RENAME TABLE `vn`.`workerRelatives` TO `vn`.`workerRelative`; -- RENAME TABLE `vn`.`workerRelatives` TO `vn`.`workerRelative`;
ALTER TABLE vn.workerRelative ADD CONSTRAINT `workerRelatives_disabilityGradeFk` FOREIGN KEY (`disabilityGradeFk`) REFERENCES `disabilityGrade` (`id`) ON UPDATE CASCADE; -- ALTER TABLE vn.workerRelative ADD CONSTRAINT `workerRelatives_disabilityGradeFk` FOREIGN KEY (`disabilityGradeFk`) REFERENCES `disabilityGrade` (`id`) ON UPDATE CASCADE;
ALTER TABLE vn.workerRelative ADD CONSTRAINT `workerRelatives_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `workerIrpf` (`workerFk`) ON DELETE CASCADE ON UPDATE CASCADE; -- ALTER TABLE vn.workerRelative ADD CONSTRAINT `workerRelatives_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `workerIrpf` (`workerFk`) ON DELETE CASCADE ON UPDATE CASCADE;
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) -- INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES -- VALUES
('Worker','workerRelative','*','ALLOW','ROLE','hr'), -- ('workerRelative','*','*','ALLOW','ROLE','hr'),
('Worker','workerIrpf','*','ALLOW','ROLE','hr'), -- ('workerIrpf','*','*','ALLOW','ROLE','hr'),
('Worker','disabilityGrade','*','ALLOW','ROLE','hr'); -- ('disabilityGrade','*','*','ALLOW','ROLE','hr');

View File

@ -0,0 +1,15 @@
ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_disabilityGradeFk;
ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_workerFk;
-- RENAME TABLE `vn`.`workerRelatives` TO `vn`.`workerRelative`;
carlossa marked this conversation as resolved
Review

Comentat?

Comentat?
-- ALTER TABLE vn.workerRelative ADD CONSTRAINT `workerRelatives_disabilityGradeFk` FOREIGN KEY (`disabilityGradeFk`) REFERENCES `disabilityGrade` (`id`) ON UPDATE CASCADE;
-- ALTER TABLE vn.workerRelative ADD CONSTRAINT `workerRelatives_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `workerIrpf` (`workerFk`) ON DELETE CASCADE ON UPDATE CASCADE;
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES
('workerRelatives','*','*','ALLOW','ROLE','hr'),
('workerIrpf','*','*','ALLOW','ROLE','hr'),
('disabilityGrade','*','*','ALLOW','ROLE','hr');