|
|
|
@ -25,7 +25,7 @@ export class UserController {
|
|
|
|
|
|
|
|
|
|
@Get()
|
|
|
|
|
@Authorized("USER:GET")
|
|
|
|
|
@ResponseSchema(User, { isArray: true })
|
|
|
|
|
@ResponseSchema(ResponseUser, { isArray: true })
|
|
|
|
|
@OpenAPI({ description: 'Lists all users. <br> This includes their groups and permissions directly granted to them (if existing/associated).' })
|
|
|
|
|
async getAll() {
|
|
|
|
|
let responseUsers: ResponseUser[] = new Array<ResponseUser>();
|
|
|
|
@ -38,7 +38,7 @@ export class UserController {
|
|
|
|
|
|
|
|
|
|
@Get('/:id')
|
|
|
|
|
@Authorized("USER:GET")
|
|
|
|
|
@ResponseSchema(User)
|
|
|
|
|
@ResponseSchema(ResponseUser)
|
|
|
|
|
@ResponseSchema(UserNotFoundError, { statusCode: 404 })
|
|
|
|
|
@OnUndefined(UserNotFoundError)
|
|
|
|
|
@OpenAPI({ description: 'Lists all information about the user whose id got provided. <br> Please remember that only permissions granted directly to the user will show up here, not permissions inherited from groups.' })
|
|
|
|
@ -50,7 +50,7 @@ export class UserController {
|
|
|
|
|
|
|
|
|
|
@Post()
|
|
|
|
|
@Authorized("USER:CREATE")
|
|
|
|
|
@ResponseSchema(User)
|
|
|
|
|
@ResponseSchema(ResponseUser)
|
|
|
|
|
@ResponseSchema(UserGroupNotFoundError)
|
|
|
|
|
@OpenAPI({ description: 'Create a new user. <br> If you want to grant permissions to the user you have to create them seperately by posting to /api/permissions after creating the user.' })
|
|
|
|
|
async post(@Body({ validate: true }) createUser: CreateUser) {
|
|
|
|
@ -67,7 +67,7 @@ export class UserController {
|
|
|
|
|
|
|
|
|
|
@Put('/:id')
|
|
|
|
|
@Authorized("USER:UPDATE")
|
|
|
|
|
@ResponseSchema(User)
|
|
|
|
|
@ResponseSchema(ResponseUser)
|
|
|
|
|
@ResponseSchema(UserNotFoundError, { statusCode: 404 })
|
|
|
|
|
@ResponseSchema(UserIdsNotMatchingError, { statusCode: 406 })
|
|
|
|
|
@OpenAPI({ description: "Update the user whose id you provided. <br> To change the permissions directly granted to the user please use /api/permissions instead. <br> Please remember that ids can't be changed." })
|
|
|
|
@ -88,7 +88,7 @@ export class UserController {
|
|
|
|
|
|
|
|
|
|
@Delete('/:id')
|
|
|
|
|
@Authorized("USER:DELETE")
|
|
|
|
|
@ResponseSchema(User)
|
|
|
|
|
@ResponseSchema(ResponseUser)
|
|
|
|
|
@ResponseSchema(ResponseEmpty, { statusCode: 204 })
|
|
|
|
|
@OnUndefined(204)
|
|
|
|
|
@OpenAPI({ description: 'Delete the user whose id you provided. <br> If there are any permissions directly granted to the user they will get deleted as well. <br> If no user with this id exists it will just return 204(no content).' })
|
|
|
|
|