public async Task <IActionResult> Create(RoleCreateGet Role) { var CurrentUser = await _userManager.GetUserAsync(User); Role.UserId = CurrentUser.Id; var ErrorMessages = new List <ErrorMessage>(); if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString())) { ErrorMessages = await _roleProvider.CreatePostCheck(Role); if (ErrorMessages.Count > 0) { Role = await CreateAddDropDownBoxes(Role, CurrentUser.Id); } else { _roleProvider.CreatePost(Role); } RoleCreateGetWithErrorMessages RoleWithErrorMessage = new RoleCreateGetWithErrorMessages { Role = Role, ErrorMessages = ErrorMessages }; return(Ok(RoleWithErrorMessage)); } ErrorMessages = await _checkProvider.NoRightsMessage(CurrentUser.Id); RoleCreateGetWithErrorMessages RoleWithNoRights = new RoleCreateGetWithErrorMessages { Role = Role, ErrorMessages = ErrorMessages }; return(Ok(RoleWithNoRights)); }