-
-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#1044 implement user column type #1045
base: main
Are you sure you want to change the base?
Conversation
This PR adds a new column type: User. It allows user to add a reference to another active user in organization. A list of available user names is displayed as suggestions.
for (const user of res) { | ||
const fullUser = this.makeFullUser(user); | ||
|
||
if (![...NON_LOGIN_EMAILS, SUPPORT_EMAIL].includes(fullUser.email)) { | ||
users.push({ | ||
...fullUser, | ||
access: null | ||
}); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[comment that you may dismiss, I am a bit nitpicking]
In a more functional way, you may use Array#flatMap
instead:
for (const user of res) { | |
const fullUser = this.makeFullUser(user); | |
if (![...NON_LOGIN_EMAILS, SUPPORT_EMAIL].includes(fullUser.email)) { | |
users.push({ | |
...fullUser, | |
access: null | |
}); | |
} | |
} | |
const users: UserAccessData[] = res.flatMap((user) => { | |
const fullUser = this.makeFullUser(user); | |
return [...NON_LOGIN_EMAILS, SUPPORT_EMAIL].includes(fullUser.email)) ? [] : [{ | |
...fullUser, | |
access: null, | |
}]; | |
}); |
const users = await this._dbManager.getUsers(); | ||
|
||
return sendReply(req, res, users); | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if that would not be a security issue, considering that it would expose the list of every users of an instance (their name and their email), no matter what access to their information the requester have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my use case, I control all users in the instance, so there is no problem. You know more use cases, so you know if there is one that listing all users might be a security issue. Do you think it would be better to list only users who have access to the current site?
This PR adds a new column type: User. It allows user to add a reference to another active user in organization. A list of available user names is displayed as suggestions.