diff --git a/core/server/models/user.js b/core/server/models/user.js index a0743de8cf..1bd69854c6 100644 --- a/core/server/models/user.js +++ b/core/server/models/user.js @@ -322,6 +322,24 @@ User = ghostBookshelf.Model.extend({ delete options.status; return filter; + }, + + getAction(event, options) { + const actor = this.getActor(options); + + // @NOTE: we ignore internal updates (`options.context.internal`) for now + if (!actor) { + return; + } + + // @TODO: implement context + return { + event: event, + resource_id: this.id || this.previous('id'), + resource_type: 'user', + actor_id: actor.id, + actor_type: actor.type + }; } }, { orderDefaultOptions: function orderDefaultOptions() {