mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) log user attribution in absence of client
Summary: attribute ActiveDoc log messages to users regardless of whether they were triggered via a client or directly via api Test Plan: log messages checked manually Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2786
This commit is contained in:
parent
47ea00dea3
commit
dcc4354da6
@ -180,11 +180,13 @@ export class ActiveDoc extends EventEmitter {
|
|||||||
public getLogMeta(docSession: OptDocSession, docMethod?: string): log.ILogMeta {
|
public getLogMeta(docSession: OptDocSession, docMethod?: string): log.ILogMeta {
|
||||||
const client = docSession.client;
|
const client = docSession.client;
|
||||||
const access = getDocSessionAccess(docSession);
|
const access = getDocSessionAccess(docSession);
|
||||||
|
const user = getDocSessionUser(docSession);
|
||||||
return {
|
return {
|
||||||
docId: this._docName,
|
docId: this._docName,
|
||||||
access,
|
access,
|
||||||
...(docMethod ? {docMethod} : {}),
|
...(docMethod ? {docMethod} : {}),
|
||||||
...(client ? client.getLogMeta() : {}),
|
...(user ? {userId: user.id, email: user.email} : {}),
|
||||||
|
...(client ? client.getLogMeta() : {}), // Client if present will repeat and add to user info.
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user