hudson.model.Hudson.getACL()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(166)

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

Hudson.getACL介绍

[英]Returns the root ACL.
[中]返回根ACL。

代码示例

代码示例来源:origin: org.jvnet.hudson.plugins/ci-game

public ACL getACL() {
  return Hudson.getInstance().getACL();
}

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

public ACL getACL() {
  return Hudson.getInstance().getACL();
}

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

public ACL getACL() {
  return Hudson.getInstance().getACL();
}

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

public ACL getACL() {
  return Hudson.getInstance().getACL();
}

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

public ACL getACL() {
  return Hudson.getInstance().getACL();
}

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

/**
 * Checks if the current user (for which we are processing the current request)
 * has the admin access.
 *
 * @deprecated since 2007-12-18.
 *      This method is deprecated when Hudson moved from simple Unix root-like model
 *      of "admin gets to do everything, and others don't have any privilege" to more
 *      complex {@link ACL} and {@link Permission} based scheme.
 *
 *      <p>
 *      For a quick migration, use {@code Hudson.getInstance().getACL().hasPermission(Hudson.ADMINISTER)}
 *      To check if the user has the 'administer' role in Hudson.
 *
 *      <p>
 *      But ideally, your plugin should first identify a suitable {@link Permission} (or create one,
 *      if appropriate), then identify a suitable {@link AccessControlled} object to check its permission
 *      against.
 */
public static boolean isAdmin() {
  return Hudson.getInstance().getACL().hasPermission(ADMINISTER);
}

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

/**
 * Checks if the current user (for which we are processing the current request)
 * has the admin access.
 *
 * @deprecated since 2007-12-18.
 *      This method is deprecated when Hudson moved from simple Unix root-like model
 *      of "admin gets to do everything, and others don't have any privilege" to more
 *      complex {@link ACL} and {@link Permission} based scheme.
 *
 *      <p>
 *      For a quick migration, use {@code Hudson.getInstance().getACL().hasPermission(Hudson.ADMINISTER)}
 *      To check if the user has the 'administer' role in Hudson.
 *
 *      <p>
 *      But ideally, your plugin should first identify a suitable {@link Permission} (or create one,
 *      if appropriate), then identify a suitable {@link AccessControlled} object to check its permission
 *      against.
 */
public static boolean isAdmin() {
  return Hudson.getInstance().getACL().hasPermission(ADMINISTER);
}

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

/**
 * Checks if the current user (for which we are processing the current request)
 * has the admin access.
 *
 * @deprecated since 2007-12-18.
 *      This method is deprecated when Hudson moved from simple Unix root-like model
 *      of "admin gets to do everything, and others don't have any privilege" to more
 *      complex {@link ACL} and {@link Permission} based scheme.
 *
 *      <p>
 *      For a quick migration, use {@code Hudson.getInstance().getACL().hasPermission(Hudson.ADMINISTER)}
 *      To check if the user has the 'administer' role in Hudson.
 *
 *      <p>
 *      But ideally, your plugin should first identify a suitable {@link Permission} (or create one,
 *      if appropriate), then identify a suitable {@link AccessControlled} object to check its permission
 *      against.
 */
public static boolean isAdmin() {
  return Hudson.getInstance().getACL().hasPermission(ADMINISTER);
}

代码示例来源:origin: org.jvnet.hudson.plugins/ci-game

public void doResetScores( StaplerRequest req, StaplerResponse rsp ) throws IOException {
  if (Hudson.getInstance().getACL().hasPermission(Hudson.ADMINISTER)) {
    doResetScores(User.getAll());
  }
  rsp.sendRedirect2(req.getContextPath());
}

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

private boolean checkUserScoreChange(String score) throws FormException {
    if (getCurrentUserScore() != getRequestScore(score)) {
      if (!Hudson.getInstance().getACL().hasPermission(Hudson.ADMINISTER)) {
        throw new FormException(Messages.UserScore_Cheating_Message(), "score");
      }
    }
    return true;
  }
}

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

public void doResetScores( StaplerRequest req, StaplerResponse rsp ) throws IOException {
  if (Hudson.getInstance().getACL().hasPermission(Hudson.ADMINISTER)) {
    doResetScores(User.getAll());
  }
  rsp.sendRedirect2(req.getContextPath());
}

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

boolean hudsonAdmin = Hudson.getInstance().getACL()
  .hasPermission(Hudson.ADMINISTER);
if (p==null) {

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

String rev = Util.fixEmptyAndTrim(req.getParameter("rev"));
Hudson.getInstance().getACL().checkPermission(Item.BUILD);

代码示例来源:origin: org.jvnet.hudson.plugins/ivy

String rev = Util.fixEmptyAndTrim(req.getParameter("rev"));
Hudson.getInstance().getACL().checkPermission(Item.BUILD);

代码示例来源:origin: org.hudsonci.plugins/ivy

String rev = Util.fixEmptyAndTrim(req.getParameter("rev"));
Hudson.getInstance().getACL().checkPermission(Item.BUILD);

相关文章

Hudson类方法