diff --git a/back/models/url.json b/back/models/url.json index 8610ff28b..13f50b099 100644 --- a/back/models/url.json +++ b/back/models/url.json @@ -21,5 +21,12 @@ "type": "string", "required": true } - } + }, + "acls": [{ + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + }] + } diff --git a/back/models/vn-user.js b/back/models/vn-user.js index e910ee33c..8e9b59aab 100644 --- a/back/models/vn-user.js +++ b/back/models/vn-user.js @@ -221,12 +221,6 @@ module.exports = function(Self) { {environment: env} ]} }); - const hederaUrl = await Self.app.models.Url.findOne({ - where: {and: [ - {appName: 'hedera'}, - {environment: env} - ]} - }); const isWorker = instance.isWorker || await Self.app.models.Account.findById(instance.id, null, ctx.options); class Mailer { @@ -246,7 +240,7 @@ module.exports = function(Self) { type: 'email', to: newEmail, from: {}, - redirect: `${liliumUrl.url}verifyEmail?isWorker=${!!isWorker}&url=${hederaUrl.url}`, + redirect: `${liliumUrl.url}verifyEmail?isWorker=${!!isWorker}`, template: false, mailer: new Mailer, host: url[1].split('/')[2], diff --git a/db/changes/234001/00-account_acl.sql b/db/changes/234201/00-account_acl.sql similarity index 100% rename from db/changes/234001/00-account_acl.sql rename to db/changes/234201/00-account_acl.sql diff --git a/db/changes/234201/00-aclUrlHedera.sql b/db/changes/234201/00-aclUrlHedera.sql index 438f58178..0d38a2ae8 100644 --- a/db/changes/234201/00-aclUrlHedera.sql +++ b/db/changes/234201/00-aclUrlHedera.sql @@ -2,3 +2,8 @@ INSERT INTO `salix`.`url` (`appName`, `environment`, `url`) VALUES ('hedera', 'test', 'https://test-shop.verdnatura.es/'), ('hedera', 'production', 'https://shop.verdnatura.es/'); + +DELETE FROM `salix`.`ACL` + WHERE model = 'Url' + AND 'accessType' = 'READ' + AND principalId = 'employee';