#5666 - Loggable to mixin #1826

Merged
alexm merged 29 commits from 5666-loggable_to_mixin into dev 2024-01-04 09:21:57 +00:00
2 changed files with 43 additions and 63 deletions
Showing only changes of commit 384b5eb7c7 - Show all commits

View File

@ -1,20 +0,0 @@
const loggable = require('vn-loopback/util/log');
module.exports = function(Self, options) {
Self.once('attached', function(ctx) {
});
Self.observe('before save', async function(ctx, next) {
await loggable.translateValues(Self, ctx.currentInstance);
});
let Mixin = {
};
for (let method in Mixin) {
if (!Self.prototype[method])
Self.prototype[method] = Mixin[method];
}
};

View File

@ -1,49 +1,49 @@
{
"name": "Account",
"base": "VnModel",
"options": {
"mysql": {
"table": "account.account"
}
},
"name": "Account",
"base": "VnModel",
"options": {
"mysql": {
"table": "account.account"
}
},
"properties": {
"id": {
"id": true
}
},
"relations": {
"user": {
"type": "belongsTo",
"model": "VnUser",
"foreignKey": "id"
},
"aliases": {
"type": "hasMany",
"model": "MailAliasAccount",
"foreignKey": "account"
}
},
"acls": [
{
"property": "login",
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
"id": {
"id": true
}
},
"relations": {
"user": {
"type": "belongsTo",
"model": "VnUser",
"foreignKey": "id"
},
{
"aliases": {
"type": "hasMany",
"model": "MailAliasAccount",
"foreignKey": "account"
}
},
"acls": [
{
"property": "login",
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"property": "logout",
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW"
},
{
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW"
},
{
"property": "changePassword",
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
]
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
]
}