Skip to content
Permalink
Browse files

[JENKINS-46652] Check Computer.BUILD permission only on heayweight ta…

…sks.
  • Loading branch information
jglick committed Jan 22, 2018
1 parent b550c33 commit 9842a2795e81bbdb0aeb5039cd9953bbb0ff2531
@@ -394,7 +394,7 @@ public CauseOfBlockage canTake(Queue.BuildableItem item) {
}

Authentication identity = item.authenticate();
if (!hasPermission(identity,Computer.BUILD)) {
if (!(item.task instanceof Queue.FlyweightTask) && !hasPermission(identity, Computer.BUILD)) {
// doesn't have a permission
return CauseOfBlockage.fromMessage(Messages._Node_LackingBuildPermission(identity.getName(), getDisplayName()));
}
@@ -134,7 +134,7 @@ public boolean canAccept(WorkChunk c) {
if (c.assignedLabel!=null && !c.assignedLabel.contains(node))
return false; // label mismatch

if (!nodeAcl.hasPermission(item.authenticate(), Computer.BUILD))
if (!(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;

0 comments on commit 9842a27

Please sign in to comment.
You can’t perform that action at this time.