Authentication auth = workUnit.context.item.authenticate(); LOGGER.log(FINE, "{0} is now executing {1} as {2}", new Object[] {getName(), executable, auth}); if (LOGGER.isLoggable(FINE) && auth.equals(ACL.SYSTEM)) { // i.e., unspecified
Authentication auth = workUnit.context.item.authenticate(); LOGGER.log(FINE, "{0} is now executing {1} as {2}", new Object[] {getName(), executable, auth}); if (LOGGER.isLoggable(FINE) && auth.equals(ACL.SYSTEM)) { // i.e., unspecified
public <C extends IdCredentials> C lookupCredentials(@NonNull Class<C> type, @NonNull Run run, List<DomainRequirement> domainRequirements) { Authentication authentication = Jenkins.getAuthentication(); final Executor executor = run.getExecutor(); if (executor != null) { final WorkUnit workUnit = executor.getCurrentWorkUnit(); if (workUnit != null) { authentication = workUnit.context.item.authenticate(); } } List<C> candidates = new ArrayList<C>(); final boolean isSystem = ACL.SYSTEM.equals(authentication); if (!isSystem && run.getParent().getACL() .hasPermission(CredentialsProvider.USE_OWN)) { candidates.addAll(CredentialsProvider .lookupCredentials(type, run.getParent(), authentication, domainRequirements)); } if (run.getParent().getACL().hasPermission(CredentialsProvider.USE_ITEM) || isSystem || isDefaultValue) { candidates.addAll( CredentialsProvider.lookupCredentials(type, run.getParent(), ACL.SYSTEM, domainRequirements)); } return CredentialsMatchers.firstOrNull(candidates, CredentialsMatchers.withId(value)); }
Authentication identity = item.authenticate(); if (!getACL().hasPermission(identity,Computer.BUILD)) {
public <C extends IdCredentials> C lookupCredentials(@NonNull Class<C> type, @NonNull Run run, List<DomainRequirement> domainRequirements) { Authentication authentication = Jenkins.getAuthentication(); final Executor executor = run.getExecutor(); if (executor != null) { final WorkUnit workUnit = executor.getCurrentWorkUnit(); if (workUnit != null) { authentication = workUnit.context.item.authenticate(); } } List<C> candidates = new ArrayList<C>(); final boolean isSystem = ACL.SYSTEM.equals(authentication); if (!isSystem && run.getParent().getACL() .hasPermission(CredentialsProvider.USE_OWN)) { candidates.addAll(CredentialsProvider .lookupCredentials(type, run.getParent(), authentication, domainRequirements)); } if (run.getParent().getACL().hasPermission(CredentialsProvider.USE_ITEM) || isSystem || isDefaultValue) { candidates.addAll( CredentialsProvider.lookupCredentials(type, run.getParent(), ACL.SYSTEM, domainRequirements)); } return CredentialsMatchers.firstOrNull(candidates, CredentialsMatchers.withId(value)); }
/** * Is this executor chunk and the given work chunk compatible? Can the latter be run on the former? */ public boolean canAccept(WorkChunk c) { if (this.size()<c.size()) return false; // too small compared towork if (c.assignedLabel!=null && !c.assignedLabel.contains(node)) return false; // label mismatch if (!nodeAcl.hasPermission(item.authenticate(), Computer.BUILD)) return false; // tasks don't have a permission to run on this node return true; }
Authentication identity = item.authenticate(); if (!(SKIP_BUILD_CHECK_ON_FLYWEIGHTS && item.task instanceof Queue.FlyweightTask) && !hasPermission(identity, Computer.BUILD)) {
/** * Is this executor chunk and the given work chunk compatible? Can the latter be run on the former? */ public boolean canAccept(WorkChunk c) { if (this.size()<c.size()) return false; // too small compared towork if (c.assignedLabel!=null && !c.assignedLabel.contains(node)) return false; // label mismatch if (!(Node.SKIP_BUILD_CHECK_ON_FLYWEIGHTS && item.task instanceof Queue.FlyweightTask) && !nodeAcl.hasPermission(item.authenticate(), Computer.BUILD)) return false; // tasks don't have a permission to run on this node return true; }