Index: main/core/src/main/java/hudson/security/AuthorizationMatrixProperty.java =================================================================== --- main/core/src/main/java/hudson/security/AuthorizationMatrixProperty.java (revision 13596) +++ main/core/src/main/java/hudson/security/AuthorizationMatrixProperty.java (working copy) @@ -5,9 +5,10 @@ import hudson.model.JobProperty; import hudson.model.JobPropertyDescriptor; import hudson.model.Hudson; +import hudson.model.Run; +import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -136,7 +137,10 @@ } public List getAllGroups() { - return Collections.singletonList(PermissionGroup.get(Item.class)); + List list = new ArrayList(2); + list.add(PermissionGroup.get(Item.class)); + list.add(PermissionGroup.get(Run.class)); + return list; } public boolean showPermission(Permission p) { Index: main/core/src/main/java/hudson/Functions.java =================================================================== --- main/core/src/main/java/hudson/Functions.java (revision 13596) +++ main/core/src/main/java/hudson/Functions.java (working copy) @@ -489,8 +489,25 @@ return hasPermission(Hudson.getInstance(),permission); } - public static boolean hasPermission(AccessControlled object, Permission permission) throws IOException, ServletException { - return permission==null || object.hasPermission(permission); + /** + * This version is so that the 'hasPermission' can degrade gracefully + * if "it" is not an {@link AccessControlled} object. + */ + public static boolean hasPermission(Object object, Permission permission) throws IOException, ServletException { + if (permission == null) + return true; + if (object instanceof AccessControlled) + return ((AccessControlled)object).hasPermission(permission); + else { + List ancs = Stapler.getCurrentRequest().getAncestors(); + for(Ancestor anc : Iterators.reverse(ancs)) { + Object o = anc.getObject(); + if (o instanceof AccessControlled) { + return ((AccessControlled)o).hasPermission(permission); + } + } + return Hudson.getInstance().hasPermission(permission); + } } public static void adminCheck(StaplerRequest req, StaplerResponse rsp, Object required, Permission permission) throws IOException, ServletException { Index: main/core/src/main/resources/lib/hudson/summary.jelly =================================================================== --- main/core/src/main/resources/lib/hudson/summary.jelly (revision 13596) +++ main/core/src/main/resources/lib/hudson/summary.jelly (working copy) @@ -13,7 +13,7 @@ permission object. If specified, the link will be displayed only if you have a permission --> - + @@ -30,4 +30,4 @@ - \ No newline at end of file + Index: main/core/src/main/resources/hudson/model/AbstractBuild/index.jelly =================================================================== --- main/core/src/main/resources/hudson/model/AbstractBuild/index.jelly (revision 13596) +++ main/core/src/main/resources/hudson/model/AbstractBuild/index.jelly (working copy) @@ -3,12 +3,12 @@
- + - - + + - +
${%startedAgo(it.timestampString)}
@@ -125,4 +125,4 @@ - \ No newline at end of file +