mirror of
https://github.com/sasjs/server.git
synced 2026-01-03 21:10:05 +00:00
fix: add user to all users group on user creation
This commit is contained in:
@@ -21,9 +21,9 @@ import {
|
||||
getUserAutoExec,
|
||||
updateUserAutoExec,
|
||||
ModeType,
|
||||
AuthProviderType
|
||||
ALL_USERS_GROUP
|
||||
} from '../utils'
|
||||
import { GroupResponse } from './group'
|
||||
import { GroupController, GroupResponse } from './group'
|
||||
|
||||
export interface UserResponse {
|
||||
id: number
|
||||
@@ -237,6 +237,13 @@ const createUser = async (data: UserPayload): Promise<UserDetailsResponse> => {
|
||||
|
||||
const savedUser = await user.save()
|
||||
|
||||
const groupController = new GroupController()
|
||||
const allUsersGroup = await groupController.getGroupByGroupName(
|
||||
ALL_USERS_GROUP.name
|
||||
)
|
||||
|
||||
await groupController.addUserToGroup(allUsersGroup.groupId, savedUser.id)
|
||||
|
||||
return {
|
||||
id: savedUser.id,
|
||||
displayName: savedUser.displayName,
|
||||
|
||||
Reference in New Issue
Block a user