diff --git a/server/middleware/src/private.ts b/server/middleware/src/private.ts index c6c00131c38..0314b6fe006 100644 --- a/server/middleware/src/private.ts +++ b/server/middleware/src/private.ts @@ -64,7 +64,11 @@ export class PrivateMiddleware extends BaseMiddleware implements Middleware { if (account !== tx.modifiedBy && account !== core.account.System) { throw new PlatformError(new Status(Severity.ERROR, platform.status.Forbidden, {})) } + const modifiedByAccount = await this.storage.modelDb.findAll(core.class.Account, { _id: tx.modifiedBy }) target = [ctx.userEmail, systemAccountEmail] + if (modifiedByAccount.length > 0 && !target.includes(modifiedByAccount[0].email)) { + target.push(modifiedByAccount[0].email) + } } } const res = await this.provideTx(ctx, tx)