/// <summary>Reverts the userPermission.</summary>
        /// <param name="userPermissionEmployeeIdDetails">The userPermission identifier details.</param>
        /// <param name="userPermissionDetails">The userPermission details.</param>
        /// <returns>
        ///   <br />
        /// </returns>
        public async Task <CSSResponse> RevertUserPermission(UserPermissionEmployeeIdDetails userPermissionEmployeeIdDetails, UpdateUserPermissionDTO userPermissionDetails)
        {
            UserPermission userPermission = await _repository.UserPermissions.GetAllUserPermission(userPermissionEmployeeIdDetails);

            if (userPermission == null)
            {
                return(new CSSResponse(HttpStatusCode.NotFound));
            }

            var userPermissions = await _repository.UserPermissions.GetAllUserPermissionsBySso(new UserPermissionSsoDetails { Sso = userPermissionDetails.Sso });

            if (userPermissions?.Count > 0 && userPermissions.IndexOf(userPermission.Id) == -1)
            {
                return(new CSSResponse($"User Permission with sso '{userPermissionDetails.Sso}' already exists.", HttpStatusCode.Conflict));
            }

            var userPermissionRequest = _mapper.Map(userPermissionDetails, userPermission);

            _repository.UserPermissions.UpdateUserPermission(userPermissionRequest);

            await _repository.SaveAsync();

            return(new CSSResponse(HttpStatusCode.NoContent));
        }
        public async Task <IActionResult> UpdateAgent(string employeeId, [FromBody] UpdateUserPermissionDTO agentDetails)
        {
            var result = await _agentService.UpdateUserPermission(new UserPermissionEmployeeIdDetails { EmployeeId = employeeId }, agentDetails);

            return(StatusCode((int)result.Code, result.Value));
        }