-- 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;

