salix/db/changes/231601/00-modelsAcls.sql

29 lines
1.4 KiB
SQL

-- DmsType model
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
SELECT 'DmsType', d.code, 'WRITE', 'ALLOW', 'ROLE', r.name
FROM `vn`.`dmsType` d
JOIN `account`.`role` r ON r.id = d.writeRoleFk;
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
SELECT 'DmsType', d.code, 'READ', 'ALLOW', 'ROLE', r.name
FROM `vn`.`dmsType` d
JOIN `account`.`role` r ON r.id = d.readRoleFk;
-- ImageCollection model
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
SELECT 'ImageCollection', i.name, 'WRITE', 'ALLOW', 'ROLE', r.name
FROM `hedera`.`imageCollection` i
JOIN `account`.`role` r ON r.id = i.writeRoleFk;
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
SELECT 'ImageCollection', i.name, 'READ', 'ALLOW', 'ROLE', r.name
FROM `hedera`.`imageCollection` i
JOIN `account`.`role` r ON r.id = i.readRoleFk;
-- ClaimState
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
SELECT 'ClaimState', c.code, 'WRITE', 'ALLOW', 'ROLE', r.name
FROM `vn`.`claimState` c
JOIN `account`.`role` r ON r.id = c.roleFk;