未验证 提交 6e14a7ec 编写于 作者: O Oleg Nenashev 提交者: GitHub

Merge pull request #5013 from oleg-nenashev/bug/JENKINS-63868

[JENKINS-63868] - Prevent the Build History Widget from exploding when user have Discover permissions without Read for folders
...@@ -36,6 +36,7 @@ import jenkins.model.CauseOfInterruption; ...@@ -36,6 +36,7 @@ import jenkins.model.CauseOfInterruption;
import jenkins.model.CauseOfInterruption.UserInterruption; import jenkins.model.CauseOfInterruption.UserInterruption;
import jenkins.model.InterruptedBuildAction; import jenkins.model.InterruptedBuildAction;
import jenkins.model.Jenkins; import jenkins.model.Jenkins;
import org.acegisecurity.AccessDeniedException;
import org.acegisecurity.Authentication; import org.acegisecurity.Authentication;
import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.HttpResponses; import org.kohsuke.stapler.HttpResponses;
...@@ -892,6 +893,12 @@ public class Executor extends Thread implements ModelObject { ...@@ -892,6 +893,12 @@ public class Executor extends Thread implements ModelObject {
lock.readLock().lock(); lock.readLock().lock();
try { try {
return executable != null && getParentOf(executable).getOwnerTask().hasAbortPermission(); 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 { } finally {
lock.readLock().unlock(); lock.readLock().unlock();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册