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

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

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

Hudson.isUseSecurity介绍

[英]A convenience method to check if there's some security restrictions in place.
[中]一种检查是否存在某些安全限制的方便方法。

代码示例

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

/**
 * If the security is not enabled, there's no point in having
 * this type of views.
 */
@Override
public boolean isInstantiable() {
  return Hudson.getInstance().isUseSecurity();
}

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

/**
 * If the security is not enabled, there's no point in having
 * this type of views.
 */
@Override
public boolean isInstantiable() {
  return Hudson.getInstance().isUseSecurity();
}

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

/**
 * If the security is not enabled, there's no point in having
 * this type of views.
 */
@Override
public boolean isInstantiable() {
  return Hudson.getInstance().isUseSecurity();
}

代码示例来源:origin: org.jenkins-ci.plugins/build-pipeline-plugin

/**
 * Checks whether the user has Build permission for the current project.
 *
 * @return - true: Has Build permission; false: Does not have Build permission
 * @see hudson.model.Item
 */
public boolean hasBuildPermission() {
  boolean buildPermission = false;
  // If no security is enabled then allow builds
  if (!Hudson.getInstance().isUseSecurity()) {
    LOGGER.fine("Security is not enabled.");
    buildPermission = true;
  } else if (this.project != null) {
    // If security is enabled check if BUILD is enabled
    buildPermission = this.project.hasPermission(Item.BUILD);
  }
  LOGGER.fine("Is user allowed to build? -> " + buildPermission);
  return buildPermission;
}

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

|| !Hudson.getInstance().isUseSecurity()) {

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

|| !Hudson.getInstance().isUseSecurity()) {

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

|| !Hudson.getInstance().isUseSecurity()) {

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

public static void checkPermission(AbstractProject project, BuildAuthorizationToken token, StaplerRequest req, StaplerResponse rsp) throws IOException {
  if (!Hudson.getInstance().isUseSecurity())
    return;    // everyone is authorized
  if(token!=null && token.token != null) {
    //check the provided token
    String providedToken = req.getParameter("token");
    if (providedToken != null && providedToken.equals(token.token))
      return;
    if (providedToken != null)
      throw new AccessDeniedException(Messages.BuildAuthorizationToken_InvalidTokenProvided());
  }
  project.checkPermission(AbstractProject.BUILD);
}

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

public static void checkPermission(AbstractProject project, BuildAuthorizationToken token, StaplerRequest req, StaplerResponse rsp) throws IOException {
  if (!Hudson.getInstance().isUseSecurity())
    return;    // everyone is authorized
  if(token!=null && token.token != null) {
    //check the provided token
    String providedToken = req.getParameter("token");
    if (providedToken != null && providedToken.equals(token.token))
      return;
    if (providedToken != null)
      throw new AccessDeniedException(Messages.BuildAuthorizationToken_InvalidTokenProvided());
  }
  project.checkPermission(AbstractProject.BUILD);
}

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

public static void checkPermission(AbstractProject project, BuildAuthorizationToken token, StaplerRequest req, StaplerResponse rsp) throws IOException {
  if (!Hudson.getInstance().isUseSecurity())
    return;    // everyone is authorized
  if(token!=null && token.token != null) {
    //check the provided token
    String providedToken = req.getParameter("token");
    if (providedToken != null && providedToken.equals(token.token))
      return;
    if (providedToken != null)
      throw new AccessDeniedException(Messages.BuildAuthorizationToken_InvalidTokenProvided());
  }
  project.checkPermission(AbstractProject.BUILD);
}

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

FilterChain chain) throws IOException, ServletException {
if (Hudson.getInstance().isUseSecurity()) {

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

if (!isUseSecurity() || v == null || v.equals("random")) {
  slaveAgentPort = 0;
} else if (v.equals("disable")) {

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

if (!isUseSecurity() || v == null || v.equals("random")) {
  slaveAgentPort = 0;
} else if (v.equals("disable")) {

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

if (!isUseSecurity() || v == null || v.equals("random")) {
  slaveAgentPort = 0;
} else if (v.equals("disable")) {

相关文章

Hudson类方法