mirror of
				https://github.com/gristlabs/grist-core.git
				synced 2025-06-13 20:53:59 +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 {
 | 
			
		||||
    const client = docSession.client;
 | 
			
		||||
    const access = getDocSessionAccess(docSession);
 | 
			
		||||
    const user = getDocSessionUser(docSession);
 | 
			
		||||
    return {
 | 
			
		||||
      docId: this._docName,
 | 
			
		||||
      access,
 | 
			
		||||
      ...(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