code: @PUT
      @Produces(MediaType.APPLICATION_JSON)
      @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
      @Path("/{userId}/privileged")
      @Description("Grants or revokes privileged permissions")
      public PrincipalUserDto updateUserPrivilege(@Context HttpServletRequest req,
          @PathParam("userId") final BigInteger userId,
          @FormParam("privileged") final boolean privileged) {
          validatePrivilegedUser(req);
          if (userId == null || userId.compareTo(BigInteger.ZERO) < 1) {
              throw new WebApplicationException("User Id cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
          }
  
          PrincipalUser user = _uService.findUserByPrimaryKey(userId);
  
          if (user == null) {
              throw new WebApplicationException(Response.Status.NOT_FOUND.getReasonPhrase(), Response.Status.NOT_FOUND);
          }
          try {
              Method method = PrincipalUser.class.getDeclaredMethod("setPrivileged", boolean.class);
  
              method.setAccessible(true);
              method.invoke(user, privileged);
          } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
              throw new SystemException("Failed to change privileged status.", e);
          }
          user = _uService.updateUser(user);
          return PrincipalUserDto.transformToDto(user);
      }
docs: Grants or revokes privileged permissions.
  
  @param   req         The HTTP request.
  @param   userId      The ID of the user to update.
  @param   privileged  True if the user has privileged access.
  
  @return  The updated user DTO.
  
  @throws  WebApplicationException  If an error occurs.
  @throws  SystemException          If the privileged status is unable to be changed.