Skip to content

Commit

Permalink
Merge pull request #5013 from oleg-nenashev/bug/JENKINS-63868
Browse files Browse the repository at this point in the history
[JENKINS-63868] - Prevent the Build History Widget from exploding when user have Discover permissions without Read for folders
  • Loading branch information
oleg-nenashev authored Oct 26, 2020
2 parents d68a3d2 + 7ccf1ba commit 6e14a7e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/main/java/hudson/model/Executor.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import jenkins.model.CauseOfInterruption.UserInterruption;
import jenkins.model.InterruptedBuildAction;
import jenkins.model.Jenkins;
import org.acegisecurity.AccessDeniedException;
import org.acegisecurity.Authentication;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.HttpResponses;
Expand Down Expand Up @@ -892,6 +893,12 @@ public boolean hasStopPermission() {
lock.readLock().lock();
try {
return executable != null && getParentOf(executable).getOwnerTask().hasAbortPermission();
} catch(Exception ex) {
if (!(ex instanceof AccessDeniedException)) {
// Prevents UI from exploding in the case of unexpected runtime exceptions
LOGGER.log(WARNING, "Unhandled exception", ex);
}
return false;
} finally {
lock.readLock().unlock();
}
Expand Down

0 comments on commit 6e14a7e

Please sign in to comment.