mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
Member Settings / Download my data and GET /api/user/export give the signed-in person their account without secrets and every row of every collection the personal-data inventory says holds their data, with a manifest of what is in it and what is not, and why. Of a shared board, card or list only their own part. Secrets are removed at every depth. An administrator can export any account with userId=, recorded in the Audit log. The menu label is translated in every language (docs/Compliance/README.md WP-5; WP-4 recorded there too). Thanks to xet7 !
28 lines
1.0 KiB
JavaScript
28 lines
1.0 KiB
JavaScript
// An administrator's action taken through an HTTP route rather than a Meteor
|
|
// method - the personal-data export of another account (WP-5) - recorded in
|
|
// the same Admin Panel / People / Audit log as the audited methods
|
|
// (server/adminAudit.js), with the address the request came from.
|
|
import { AdminAuditLog } from '/server/adminAudit';
|
|
|
|
const { auditArgs } = require('/models/lib/adminAudit');
|
|
|
|
export function recordAdminRouteAction(actor, method, args, ip, error) {
|
|
const failed = e => console.error('[admin-audit] could not record', method, e && e.message);
|
|
try {
|
|
return AdminAuditLog.insertAsync({
|
|
at: new Date(),
|
|
actorId: actor._id,
|
|
actorUsername: actor.username || '',
|
|
method,
|
|
args: auditArgs(method, args),
|
|
ok: !error,
|
|
error: error ? String(error.message || error).slice(0, 200) : undefined,
|
|
ip: ip || '',
|
|
}).catch(failed);
|
|
} catch (e) {
|
|
// The audit trail must never change what the route did or answered.
|
|
failed(e);
|
|
return Promise.resolve();
|
|
}
|
|
}
|