From e1c25beacc7ffd617810fb4365edab9ee56af86b Mon Sep 17 00:00:00 2001 From: rseguy Date: Fri, 27 Aug 2010 13:36:27 +0000 Subject: [PATCH] [FIXED HUDSON-1871] git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@34172 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/Functions.java | 18 +++- core/src/main/java/hudson/model/Run.java | 9 +- .../hudson/model/AbstractBuild/index.jelly | 6 +- .../hudson/model/AbstractProject/main.jelly | 6 +- .../hudson/model/ExternalRun/sidepanel.jelly | 4 +- .../hudson/model/Messages.properties | 6 +- .../hudson/model/Run/artifacts-index.jelly | 30 +++--- .../resources/lib/hudson/artifactList.jelly | 94 ++++++++++--------- .../hudson/maven/MavenModuleSet/index.jelly | 6 +- 9 files changed, 108 insertions(+), 71 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 87edf95188..4b08a8d92b 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2,7 +2,7 @@ * The MIT License * * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, - * Yahoo! Inc., Stephen Connolly, Tom Huybrechts, Alan Harder + * Yahoo! Inc., Stephen Connolly, Tom Huybrechts, Alan Harder, Romain Seguy * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -1266,4 +1266,20 @@ public class Functions { public static boolean getIsUnitTest() { return Main.isUnitTest; } + + /** + * Returns {@code true} if the {@link Run#ARTIFACTS} permission is enabled, + * {@code false} otherwise. + * + *

When the {@link Run#ARTIFACTS} permission is not turned on using the + * {@code hudson.security.ArtifactsPermission}, this permission must not be + * considered to be set to {@code false} for every user. It must rather be + * like if the permission doesn't exist at all (which means that every user + * has to have an access to the artifacts but the permission can't be + * configured in the security screen). Got it?

+ */ + public static boolean isArtifactsPermissionEnabled() { + return Boolean.getBoolean("hudson.security.ArtifactsPermission"); + } + } diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index c92b7880da..e90404c374 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -2,7 +2,7 @@ * The MIT License * * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, - * Daniel Dyer, Red Hat, Inc., Tom Huybrechts + * Daniel Dyer, Red Hat, Inc., Tom Huybrechts, Romain Seguy * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,6 +24,7 @@ */ package hudson.model; +import hudson.Functions; import hudson.AbortException; import hudson.BulkChange; import hudson.EnvVars; @@ -1530,6 +1531,9 @@ public abstract class Run ,RunT extends Run,RunT extends Run { public String getEntryTitle(Run entry) { diff --git a/core/src/main/resources/hudson/model/AbstractBuild/index.jelly b/core/src/main/resources/hudson/model/AbstractBuild/index.jelly index fe23d62c2b..c66658b7ad 100644 --- a/core/src/main/resources/hudson/model/AbstractBuild/index.jelly +++ b/core/src/main/resources/hudson/model/AbstractBuild/index.jelly @@ -1,7 +1,8 @@ - - - - - ${%Build Artifacts} - - - - + + + + + + ${%Build Artifacts} + + + + + \ No newline at end of file diff --git a/core/src/main/resources/lib/hudson/artifactList.jelly b/core/src/main/resources/lib/hudson/artifactList.jelly index 258227448b..9b23cfa241 100644 --- a/core/src/main/resources/lib/hudson/artifactList.jelly +++ b/core/src/main/resources/lib/hudson/artifactList.jelly @@ -1,7 +1,7 @@ - - - - - - - - -
- -
- - - + + + + + + + + +
+ +
+ + + + diff --git a/maven-plugin/src/main/resources/hudson/maven/MavenModuleSet/index.jelly b/maven-plugin/src/main/resources/hudson/maven/MavenModuleSet/index.jelly index 690b6c181f..c7b04562e2 100644 --- a/maven-plugin/src/main/resources/hudson/maven/MavenModuleSet/index.jelly +++ b/maven-plugin/src/main/resources/hudson/maven/MavenModuleSet/index.jelly @@ -1,7 +1,8 @@