code: @PUT
      @Path("/administratorprivilege")
      @Produces(MediaType.APPLICATION_JSON)
      @Description("Grants administrative privileges.")
      public Response setAdministratorPrivilege(@Context HttpServletRequest req,
          @FormParam("username") String userName,
          @FormParam("privileged") boolean privileged) {
          if (userName == null || userName.isEmpty()) {
              throw new IllegalArgumentException("User name cannot be null or empty.");
          }
          validatePrivilegedUser(req);
  
          PrincipalUser user = userService.findUserByUsername(userName);
  
          if (user == null) {
              throw new WebApplicationException("User does not exist.", Status.NOT_FOUND);
          }
          managementService.setAdministratorPrivilege(user, privileged);
          return Response.status(Status.OK).build();
      }
docs: Updates the admin privileges for the user.
  
  @param   req         The HTTP request.
  @param   userName    Name of the user whom the admin privileges will be updated. Cannot be null or empty.
  @param   privileged  boolean variable indicating admin privileges.
  
  @return  Response object indicating whether the operation was successful or not.
  
  @throws  IllegalArgumentException  Throws IllegalArgument exception when the input is not valid.
  @throws  WebApplicationException   Throws this exception if the user does not exist or the user is not authorized to carry out this operation.