public async Task <IActionResult> ChangePosition([FromRoute] string username, [FromBody] ClientChangePositionRequest request) { if (string.IsNullOrEmpty(request.NewPosition)) { return(BadRequest("Request model is not correct")); } var userRole = HttpContext.User.Claims.FirstOrDefault(x => x.Type == "Role").Value.ToString(); if (request.NewPosition.Length < 2) { return(BadRequest("Length should be more then 1 chars")); } if (userRole != "admin") { return(Forbid()); } var changeResponse = await _clientDataService.ChangePositionAsync(username, request.NewPosition); if (changeResponse.Success) { return(Ok("Role chage is successful")); } else { return(BadRequest(changeResponse.ErrorsMessages)); } }