mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Adding new column in users table "ref" with unique identifier.
Summary: There is a new column in users table called ref (user reference). It holds user's unique reference number that can be used for features that require some kind of ownership logic (like comments). Test Plan: Updated tests Reviewers: georgegevoian, paulfitz Reviewed By: georgegevoian, paulfitz Differential Revision: https://phab.getgrist.com/D3641
This commit is contained in:
@@ -122,15 +122,17 @@ export function getDocSessionUser(docSession: OptDocSession): FullUser|null {
|
||||
const user = getUser(docSession.req);
|
||||
const email = user.loginEmail;
|
||||
if (email) {
|
||||
return {id: user.id, name: user.name, email};
|
||||
return {id: user.id, name: user.name, email, ref: user.ref};
|
||||
}
|
||||
}
|
||||
if (docSession.client) {
|
||||
const id = docSession.client.getCachedUserId();
|
||||
const ref = docSession.client.getCachedUserRef();
|
||||
const profile = docSession.client.getProfile();
|
||||
if (id && profile) {
|
||||
return {
|
||||
id,
|
||||
ref,
|
||||
...profile
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user