Skip to content

Commit

Permalink
[FIXED JENKINS-31649] Check should be against AccessControlled and Pe…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
stephenc committed Nov 19, 2015
1 parent 2327618 commit cf1fdf9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/main/java/hudson/model/Queue.java
Expand Up @@ -799,8 +799,9 @@ public Item[] getItems() {
}

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);
}
}
Expand Down

0 comments on commit cf1fdf9

Please sign in to comment.