public async Task <IActionResult> EditUserRights([FromBody] EditUserRightsRequest request) { var result = _securityService.EditUserRights(request.UserId, request.RoleIds, request.FunctionIds, request.AccessedRightsIds, request.DeniedRightsIds); return(Ok(await result)); }
/// <summary> /// /// </summary> /// <param name="request"></param> /// <returns>ActionResponse</returns> public ActionResponse UserRightsEditUserRights(EditUserRightsRequest request) { // verify the required parameter 'request' is set if (request == null) { throw new ApiException(400, "Missing required parameter 'request' when calling UserRightsEditUserRights"); } var path = "/api/security/rights/user"; path = path.Replace("{format}", "json"); var queryParams = new Dictionary <String, String>(); var headerParams = new Dictionary <String, String>(); var formParams = new Dictionary <String, String>(); var fileParams = new Dictionary <String, FileParameter>(); String postBody = null; postBody = ApiClient.Serialize(request); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { }; // make the HTTP request IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); if (((int)response.StatusCode) >= 400) { throw new ApiException((int)response.StatusCode, "Error calling UserRightsEditUserRights: " + response.Content, response.Content); } else if (((int)response.StatusCode) == 0) { throw new ApiException((int)response.StatusCode, "Error calling UserRightsEditUserRights: " + response.ErrorMessage, response.ErrorMessage); } return((ActionResponse)ApiClient.Deserialize(response.Content, typeof(ActionResponse), response.Headers)); }