mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
SCIM: Implement egress + tests
This commit is contained in:
@@ -441,6 +441,10 @@ export class HomeDBManager extends EventEmitter {
|
||||
return this._usersManager.getUser(userId, options);
|
||||
}
|
||||
|
||||
public async getUsers() {
|
||||
return this._usersManager.getUsers();
|
||||
}
|
||||
|
||||
public async getFullUser(userId: number) {
|
||||
return this._usersManager.getFullUser(userId);
|
||||
}
|
||||
@@ -3271,7 +3275,7 @@ export class HomeDBManager extends EventEmitter {
|
||||
// Get the user objects which map to non-null values in the userDelta.
|
||||
const userIds = Object.keys(userDelta).filter(userId => userDelta[userId])
|
||||
.map(userIdStr => parseInt(userIdStr, 10));
|
||||
const users = await this._usersManager.getUsers(userIds, manager);
|
||||
const users = await this._usersManager.getUsersByIds(userIds, manager);
|
||||
|
||||
// Add unaffected users to the delta so that we have a record of where they are.
|
||||
groups.forEach(grp => {
|
||||
|
||||
@@ -657,10 +657,14 @@ export class UsersManager {
|
||||
return [this.getSupportUserId(), this.getAnonymousUserId(), this.getEveryoneUserId()];
|
||||
}
|
||||
|
||||
public async getUsers() {
|
||||
return await User.find({relations: ["logins"]});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Promise for an array of User entites for the given userIds.
|
||||
*/
|
||||
public async getUsers(userIds: number[], optManager?: EntityManager): Promise<User[]> {
|
||||
public async getUsersByIds(userIds: number[], optManager?: EntityManager): Promise<User[]> {
|
||||
if (userIds.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user