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

x33g5p2x  于2022-01-21 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(105)

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

Item.getACL介绍

暂无

代码示例

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

if (!item.getACL().hasPermission(auth, Item.BUILD)) {
  return FormValidation.error(Messages.BuildTrigger_you_have_no_permission_to_build_(projectName));

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

auth = Jenkins.ANONYMOUS;
if (!item.getACL().hasPermission(auth, Item.BUILD)) {
  return FormValidation.error(Messages.BuildTrigger_you_have_no_permission_to_build_(projectName));

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

public StandardListBoxModel doFillDefaultValueItems(@AncestorInPath Item context,
                          @QueryParameter(required = true) String credentialType) {
  // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline
  Jenkins jenkins = Jenkins.getActiveInstance();
  final ACL acl = context == null ? jenkins.getACL() : context.getACL();
  final Class<? extends StandardCredentials> typeClass = decodeType(credentialType);
  final List<DomainRequirement> domainRequirements = Collections.<DomainRequirement>emptyList();
  final StandardListBoxModel result = new StandardListBoxModel();
  result.includeEmptyValue();
  if (acl.hasPermission(CredentialsProvider.USE_ITEM)) {
    result.includeAs(CredentialsProvider.getDefaultAuthenticationOf(context), context, typeClass, domainRequirements);
  }
  return result;
}

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

public StandardListBoxModel doFillDefaultValueItems(@AncestorInPath Item context,
                          @QueryParameter(required = true) String credentialType) {
  // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline
  Jenkins jenkins = Jenkins.getActiveInstance();
  final ACL acl = context == null ? jenkins.getACL() : context.getACL();
  final Class<? extends StandardCredentials> typeClass = decodeType(credentialType);
  final List<DomainRequirement> domainRequirements = Collections.<DomainRequirement>emptyList();
  final StandardListBoxModel result = new StandardListBoxModel();
  result.includeEmptyValue();
  if (acl.hasPermission(CredentialsProvider.USE_ITEM)) {
    result.includeAs(CredentialsProvider.getDefaultAuthenticationOf(context), context, typeClass, domainRequirements);
  }
  return result;
}

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

public StandardListBoxModel doFillValueItems(@AncestorInPath Item context,
                         @QueryParameter(required = true) String credentialType,
                         @QueryParameter String value,
                         @QueryParameter boolean required) {
    // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline
    Jenkins jenkins = Jenkins.getActiveInstance();
    final ACL acl = context == null ? jenkins.getACL() : context.getACL();
    final Authentication authentication = Jenkins.getAuthentication();
    final Authentication itemAuthentication = CredentialsProvider.getDefaultAuthenticationOf(context);
    final boolean isSystem = ACL.SYSTEM.equals(authentication);
    final Class<? extends StandardCredentials> typeClass = decodeType(credentialType);
    final List<DomainRequirement> domainRequirements = Collections.<DomainRequirement>emptyList();
    final StandardListBoxModel result = new StandardListBoxModel();
    if (!required) {
      result.includeEmptyValue();
    }
    if (!isSystem && acl.hasPermission(CredentialsProvider.USE_OWN)) {
      result.includeAs(authentication, context, typeClass, domainRequirements);
    }
    if (acl.hasPermission(CredentialsProvider.USE_ITEM) || isSystem || itemAuthentication
        .equals(authentication)) {
      result.includeAs(itemAuthentication, context, typeClass, domainRequirements);
    }
    result.includeCurrentValue(value);
    return result;
  }
}

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

public StandardListBoxModel doFillValueItems(@AncestorInPath Item context,
                         @QueryParameter(required = true) String credentialType,
                         @QueryParameter String value,
                         @QueryParameter boolean required) {
    // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline
    Jenkins jenkins = Jenkins.getActiveInstance();
    final ACL acl = context == null ? jenkins.getACL() : context.getACL();
    final Authentication authentication = Jenkins.getAuthentication();
    final Authentication itemAuthentication = CredentialsProvider.getDefaultAuthenticationOf(context);
    final boolean isSystem = ACL.SYSTEM.equals(authentication);
    final Class<? extends StandardCredentials> typeClass = decodeType(credentialType);
    final List<DomainRequirement> domainRequirements = Collections.<DomainRequirement>emptyList();
    final StandardListBoxModel result = new StandardListBoxModel();
    if (!required) {
      result.includeEmptyValue();
    }
    if (!isSystem && acl.hasPermission(CredentialsProvider.USE_OWN)) {
      result.includeAs(authentication, context, typeClass, domainRequirements);
    }
    if (acl.hasPermission(CredentialsProvider.USE_ITEM) || isSystem || itemAuthentication
        .equals(authentication)) {
      result.includeAs(itemAuthentication, context, typeClass, domainRequirements);
    }
    result.includeCurrentValue(value);
    return result;
  }
}

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

boolean canDiscoverTheItem = itemBySystemUser.getACL().hasPermission(userAuth, Item.DISCOVER);
if (canDiscoverTheItem) {
  ItemGroup<?> current = itemBySystemUser.getParent();
      final Item i = (Item) current;
      current = i.getParent();
      if (!i.getACL().hasPermission(userAuth, Item.READ)) {
        canDiscoverTheItem = false;

相关文章