/**
* Cambios para evitar fallos en local. 
* Ya está en producción
**/


USE `vn`;
CREATE TABLE `salix`.`fieldAcl` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `model` VARCHAR(255) NULL,
  `property` VARCHAR(255) NULL,
  `actionType` SET('insert', 'update', '*') NULL DEFAULT '*',
  `role` VARCHAR(45) NULL,
  PRIMARY KEY (`id`));

INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'name', 'update', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'contact', 'update', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'email', 'update', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'phone', 'update', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'mobile', 'update', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'contactChannelFk', 'update', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'socialName', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'fi', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'street', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'postcode', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'city', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'countryFk', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'provinceFk', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'isActive', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'salesPersonFk', 'update', 'salesAssistant');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'hasToInvoice', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'isToBeMailed', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'isEqualizated', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'isFreezed', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'isVies', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'hasToInvoiceByAddress', 'update', 'salesPerson');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'isTaxDataChecked', 'update', 'salesAssistant');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'payMethodFk', 'update', 'salesAssistant');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'dueDay', 'update', 'salesAssistant');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'iban', 'update', 'salesAssistant');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'bankEntityFk', 'update', 'salesAssistant');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'hasLcr', 'update', 'salesAssistant');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'hasCoreVnl', 'update', 'salesAssistant');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'hasSepaVnl', 'update', 'salesAssistant');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Client', 'credit', 'update', 'teamBoss');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('BankEntity', '*', 'insert', 'salesAssistant');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Address', 'isDefaultAddress', '*', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Address', 'nickname', '*', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Address', 'postalCode', '*', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Address', 'provinceFk', '*', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Address', 'agencyModeFk', '*', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Address', 'phone', '*', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Address', 'mobile', '*', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Address', 'street', '*', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Address', 'city', '*', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Address', 'isActive', '*', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Address', 'isEqualizated', '*', 'salesAssistant');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Address', 'clientFk', 'insert', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('ClientObservation', '*', 'insert', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Recovery', '*', 'insert', 'administrative');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Recovery', 'finished', 'update', 'administrative');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('CreditClassification', 'finished', 'update', 'creditInsurance');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Account', '*', 'update', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Greuge', '*', 'insert', 'salesAssistant');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('ClientSample', '*', 'insert', 'employee');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Item', '*', '*', 'buyer');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('Item', '*', '*', 'marketingBoss');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('ItemBotanical', '*', '*', 'buyer');
INSERT INTO `salix`.`fieldAcl` (`model`, `property`, `actionType`, `role`) VALUES ('ClaimEnd', '*', '*', 'salesAssistant');


DELETE FROM `salix`.`ACL` WHERE `id`='28';
UPDATE `salix`.`ACL` SET `accessType`='*' WHERE `id`='60';
DELETE FROM `salix`.`ACL` WHERE `id`='59';
DELETE FROM `salix`.`ACL` WHERE `id`='57';
INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (116, 'BankEntity', '*', '*', 'ALLOW', 'role', 'employee');
INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (117, 'ClientSample', '*', '*', 'ALLOW', 'role', 'employee');
