Skip to content
Permalink
Browse files

[FIXED JENKINS-31649] Check should be against AccessControlled and Pe…

…rmission.READ

- The previous check was to narrow.
- We now check on AccessControlled (which is implemented by Item)
- We now also check on Permission.READ (which is the generic read permission)

This should allow subtasks who's task may not be an Item to at least implement AccessControlled to alow visibility.

There remains an open question as to whether tasks that are not AccessControlled should ever be visible in the UI

(cherry picked from commit cf1fdf9)
  • Loading branch information
stephenc authored and olivergondza committed Nov 25, 2015
1 parent 0056b55 commit b51653d2bfa1a8b4e854bb0991202879e7228da8
Showing with 3 additions and 2 deletions.
  1. +3 −2 core/src/main/java/hudson/model/Queue.java
@@ -800,8 +800,9 @@ private WaitingItem peek() {
}

private List<Item> filterItemListBasedOnPermissions(List<Item> r, Item t) {
if (t.task instanceof hudson.model.Item) {
if (((hudson.model.Item)t.task).hasPermission(hudson.model.Item.READ)) {
if (t.task instanceof hudson.security.AccessControlled) {
if (((hudson.security.AccessControlled)t.task).hasPermission(hudson.model.Item.READ)
|| ((hudson.security.AccessControlled) t.task).hasPermission(hudson.security.Permission.READ)) {
r.add(t);
}
}

0 comments on commit b51653d

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