code: public void upgrade() {
          ByteArrayOutputStream out = new ByteArrayOutputStream();
          if (execute(Arrays.asList("groovy", "="),
                  new ByteArrayInputStream(
                          "hudson.remoting.Channel.current().setRestricted(false)"
                                  .getBytes(defaultCharset())),
                  out, out) != 0) {
              throw new SecurityException(out.toString()); // failed to upgrade
          }
      }
docs: Attempts to lift the security restriction on the underlying channel.
  This requires the administer privilege on the server.
  
  @throws SecurityException If we fail to upgrade the connection.