hudson.security.ACL.checkPermission()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(41)

本文整理了Java中hudson.security.ACL.checkPermission()方法的一些代码示例,展示了ACL.checkPermission()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ACL.checkPermission()方法的具体详情如下:
包路径:hudson.security.ACL
类名称:ACL
方法名:checkPermission

ACL.checkPermission介绍

[英]Checks if the current security principal has this permission.

This is just a convenience function.
[中]检查当前安全主体是否具有此权限。
这只是一个方便的功能。

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Convenient short-cut for {@code getACL().checkPermission(permission)}
 */
default void checkPermission(@Nonnull Permission permission) throws AccessDeniedException {
  getACL().checkPermission(permission);
}

代码示例来源:origin: jenkinsci/jenkins

@Override
@Restricted(NoExternalUse.class)
public Object getTarget() {
  if (!SKIP_PERMISSION_CHECK) {
    if (!getACL().hasPermission(Item.DISCOVER)) {
      return null;
    }
    getACL().checkPermission(Item.READ);
  }
  return this;
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * @since 1.509.1
 */
public static void _doScript(StaplerRequest req, StaplerResponse rsp, RequestDispatcher view, VirtualChannel channel, ACL acl) throws IOException, ServletException {
  // ability to run arbitrary script is dangerous
  acl.checkPermission(RUN_SCRIPTS);
  String text = req.getParameter("script");
  if (text != null) {
    if (!"POST".equals(req.getMethod())) {
      throw HttpResponses.error(HttpURLConnection.HTTP_BAD_METHOD, "requires POST");
    }
    if (channel == null) {
      throw HttpResponses.error(HttpURLConnection.HTTP_NOT_FOUND, "Node is offline");
    }
    try {
      req.setAttribute("output",
          RemotingDiagnostics.executeGroovy(text, channel));
    } catch (InterruptedException e) {
      throw new ServletException(e);
    }
  }
  view.forward(req, rsp);
}

代码示例来源:origin: jenkinsci/jenkins

/**
   * Clears the error status.
   */
  @RequirePOST
  public synchronized void doClearError(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
    getACL().checkPermission(getPermission());

    if(workerThread!=null && !workerThread.isRunning())
      workerThread = null;
    rsp.sendRedirect(".");
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/credentials

/**
 * {@inheritDoc}
 */
@Override
public void checkPermission(@Nonnull Permission permission) throws AccessDeniedException {
  getACL().checkPermission(permission);
}

代码示例来源:origin: org.jenkins-ci.plugins/credentials

/**
 * {@inheritDoc}
 */
@Override
public void checkPermission(@Nonnull Permission permission) throws AccessDeniedException {
  getACL().checkPermission(permission);
}

代码示例来源:origin: org.jenkins-ci.plugins/credentials

/**
 * {@inheritDoc}
 */
@Override
public void checkPermission(@Nonnull Permission permission) throws AccessDeniedException {
  getACL().checkPermission(permission);
}

代码示例来源:origin: org.jenkins-ci.plugins/credentials

/**
 * {@inheritDoc}
 */
@Override
public void checkPermission(@Nonnull Permission permission) throws AccessDeniedException {
  getACL().checkPermission(permission);
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Short for {@code getACL().checkPermission(p)}
 */
public void checkPermission(Permission p) {
  getACL().checkPermission(p);
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Short for {@code getACL().checkPermission(p)}
 */
public void checkPermission(Permission p) {
  getACL().checkPermission(p);
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Convenient short-cut for {@code getACL().checkPermission(permission)}
 */
default void checkPermission(@Nonnull Permission permission) throws AccessDeniedException {
  getACL().checkPermission(permission);
}

代码示例来源:origin: jenkinsci/credentials-plugin

/**
 * {@inheritDoc}
 */
@Override
public void checkPermission(@Nonnull Permission permission) throws AccessDeniedException {
  getACL().checkPermission(permission);
}

代码示例来源:origin: jenkinsci/credentials-plugin

/**
 * {@inheritDoc}
 */
@Override
public void checkPermission(@Nonnull Permission permission) throws AccessDeniedException {
  getACL().checkPermission(permission);
}

代码示例来源:origin: jenkinsci/credentials-plugin

/**
 * {@inheritDoc}
 */
@Override
public void checkPermission(@Nonnull Permission permission) throws AccessDeniedException {
  getACL().checkPermission(permission);
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
   * Clears the error status.
   */
  public synchronized void doClearError(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
    getACL().checkPermission(getPermission());

    if(workerThread!=null && !workerThread.isRunning())
      workerThread = null;
    rsp.sendRedirect(".");
  }
}

代码示例来源:origin: hudson/hudson-2.x

/**
   * Clears the error status.
   */
  public synchronized void doClearError(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
    getACL().checkPermission(getPermission());

    if(workerThread!=null && !workerThread.isRunning())
      workerThread = null;
    rsp.sendRedirect(".");
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
   * Clears the error status.
   */
  public synchronized void doClearError(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
    getACL().checkPermission(getPermission());

    if(workerThread!=null && !workerThread.isRunning())
      workerThread = null;
    rsp.sendRedirect(".");
  }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
   * Clears the error status.
   */
  @RequirePOST
  public synchronized void doClearError(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
    getACL().checkPermission(getPermission());

    if(workerThread!=null && !workerThread.isRunning())
      workerThread = null;
    rsp.sendRedirect(".");
  }
}

代码示例来源:origin: jenkinsci/ssh-slaves-plugin

@RequirePOST
public void doSubmit(StaplerRequest request, StaplerResponse response) throws IOException, ServletException {
  getACL().checkPermission(getPermission());
  if (null != request.getParameter("Yes")) {
    HostKeyHelper.getInstance().saveHostKey(getComputer(), getHostKey());
  } else if (null == request.getParameter("No")) {
    throw new IOException("Invalid action");
  }
  complete = true;
  response.sendRedirect("../");
}

代码示例来源:origin: org.jenkins-ci.plugins/ssh-slaves

@RequirePOST
public void doSubmit(StaplerRequest request, StaplerResponse response) throws IOException, ServletException {
  getACL().checkPermission(getPermission());
  if (null != request.getParameter("Yes")) {
    HostKeyHelper.getInstance().saveHostKey(getComputer(), getHostKey());
  } else if (null == request.getParameter("No")) {
    throw new IOException("Invalid action");
  }
  complete = true;
  response.sendRedirect("../");
}

相关文章