#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", "name": "Account",
"base": "VnModel", "base": "VnModel",
"options": { "options": {
"mysql": { "mysql": {
"table": "account.account" "table": "account.account"
} }
}, },
"properties": { "properties": {
"id": { "id": {
"id": true "id": true
} }
}, },
"relations": { "relations": {
"user": { "user": {
"type": "belongsTo", "type": "belongsTo",
"model": "VnUser", "model": "VnUser",
"foreignKey": "id" "foreignKey": "id"
},
"aliases": {
"type": "hasMany",
"model": "MailAliasAccount",
"foreignKey": "account"
}
},
"acls": [
{
"property": "login",
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}, },
{ "aliases": {
"type": "hasMany",
"model": "MailAliasAccount",
"foreignKey": "account"
}
},
"acls": [
{
"property": "login",
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"property": "logout", "property": "logout",
"accessType": "EXECUTE", "accessType": "EXECUTE",
"principalType": "ROLE", "principalType": "ROLE",
"principalId": "$authenticated", "principalId": "$authenticated",
"permission": "ALLOW" "permission": "ALLOW"
}, },
{ {
"property": "changePassword", "property": "changePassword",
"accessType": "EXECUTE", "accessType": "EXECUTE",
"principalType": "ROLE", "principalType": "ROLE",
"principalId": "$everyone", "principalId": "$everyone",
"permission": "ALLOW" "permission": "ALLOW"
} }
] ]
} }