diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 2e6abc978540..965227112ac6 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2218,15 +2218,17 @@ public static boolean getIsUnitTest() { * 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} system property, this + *

When the {@link Run#ARTIFACTS} permission is not turned on, 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?

+ * + * @deprecated Use {@code Run.ARTIFACTS.getEnabled()} instead. */ + @Deprecated public static boolean isArtifactsPermissionEnabled() { - return SystemProperties.getBoolean("hudson.security.ArtifactsPermission"); + return Run.ARTIFACTS.getEnabled(); } /** @@ -2239,9 +2241,12 @@ public static boolean isArtifactsPermissionEnabled() { * trigger builds. As such, when enabling the {@code hudson.security.WipeOutPermission} * system property, a new "WipeOut" permission will allow to have greater * control on the "Wipe Out Workspace" action.

+ * + * @deprecated Use {@code Item.WIPEOUT.getEnabled()} instead. */ + @Deprecated public static boolean isWipeOutPermissionEnabled() { - return SystemProperties.getBoolean("hudson.security.WipeOutPermission"); + return Item.WIPEOUT.getEnabled(); } @Deprecated diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java index c554ef813440..e22ab0fa401c 100644 --- a/core/src/main/java/hudson/model/AbstractProject.java +++ b/core/src/main/java/hudson/model/AbstractProject.java @@ -1894,7 +1894,7 @@ public DirectoryBrowserSupport doWs(StaplerRequest req, StaplerResponse rsp) thr */ @RequirePOST public HttpResponse doDoWipeOutWorkspace() throws IOException, ServletException, InterruptedException { - checkPermission(Functions.isWipeOutPermissionEnabled() ? WIPEOUT : BUILD); + checkPermission(Item.WIPEOUT.getEnabled() ? WIPEOUT : BUILD); R b = getSomeBuildWithWorkspace(); FilePath ws = b != null ? b.getWorkspace() : null; if (ws != null && getScm().processWorkspaceBeforeDeletion(this, ws, b.getBuiltOn())) { diff --git a/core/src/main/java/hudson/model/Item.java b/core/src/main/java/hudson/model/Item.java index a57011579b15..b4f7690b241d 100644 --- a/core/src/main/java/hudson/model/Item.java +++ b/core/src/main/java/hudson/model/Item.java @@ -319,7 +319,7 @@ default void onCreatedFromScratch() { "WipeOut", Messages._AbstractProject_WipeOutPermission_Description(), null, - Functions.isWipeOutPermissionEnabled(), + SystemProperties.getBoolean("hudson.security.WipeOutPermission"), new PermissionScope[] {PermissionScope.ITEM}); Permission CANCEL = new Permission( diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index a2061b162b0b..b41868c9f548 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -2251,7 +2251,7 @@ public abstract static class StatusSummarizer implements ExtensionPoint { * @throws AccessDeniedException Access denied */ public @NonNull DirectoryBrowserSupport doArtifact() { - if (Functions.isArtifactsPermissionEnabled()) { + if (ARTIFACTS.getEnabled()) { checkPermission(ARTIFACTS); } return new DirectoryBrowserSupport(this, getArtifactManager().root(), Messages.Run_ArtifactsBrowserTitle(project.getDisplayName(), getDisplayName()), "package.png", true); @@ -2589,7 +2589,7 @@ public final class KeepLogBuildBadge implements BuildBadgeAction { public static final Permission UPDATE = new Permission(PERMISSIONS, "Update", Messages._Run_UpdatePermission_Description(), Permission.UPDATE, PermissionScope.RUN); /** See {@link hudson.Functions#isArtifactsPermissionEnabled} */ public static final Permission ARTIFACTS = new Permission(PERMISSIONS, "Artifacts", Messages._Run_ArtifactsPermission_Description(), null, - Functions.isArtifactsPermissionEnabled(), new PermissionScope[]{PermissionScope.RUN}); + SystemProperties.getBoolean("hudson.security.ArtifactsPermission"), new PermissionScope[]{PermissionScope.RUN}); private static class DefaultFeedAdapter implements FeedAdapter { @Override diff --git a/core/src/main/resources/hudson/model/AbstractProject/main.jelly b/core/src/main/resources/hudson/model/AbstractProject/main.jelly index e4fadc9e3417..55bda8740ab6 100644 --- a/core/src/main/resources/hudson/model/AbstractProject/main.jelly +++ b/core/src/main/resources/hudson/model/AbstractProject/main.jelly @@ -39,8 +39,7 @@ THE SOFTWARE. + build="${it.lastSuccessfulBuild}" baseURL="lastSuccessfulBuild/"/> diff --git a/core/src/main/resources/hudson/model/AbstractProject/sidepanel.jelly b/core/src/main/resources/hudson/model/AbstractProject/sidepanel.jelly index b626119021b7..8430b4ef6c7b 100644 --- a/core/src/main/resources/hudson/model/AbstractProject/sidepanel.jelly +++ b/core/src/main/resources/hudson/model/AbstractProject/sidepanel.jelly @@ -40,7 +40,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/hudson/model/Run/artifacts-index.jelly b/core/src/main/resources/hudson/model/Run/artifacts-index.jelly index 08f1b9821859..42ae3933c1ac 100644 --- a/core/src/main/resources/hudson/model/Run/artifacts-index.jelly +++ b/core/src/main/resources/hudson/model/Run/artifacts-index.jelly @@ -24,13 +24,13 @@ THE SOFTWARE. - - - - - - ${%Build Artifacts} - + + + + + ${%Build Artifacts} +
+ -
@@ -44,8 +44,8 @@ THE SOFTWARE.
-
-
-
+
+ + + diff --git a/core/src/main/resources/hudson/model/Run/index.jelly b/core/src/main/resources/hudson/model/Run/index.jelly index 0acdb74fb01f..8c1ffffd963e 100644 --- a/core/src/main/resources/hudson/model/Run/index.jelly +++ b/core/src/main/resources/hudson/model/Run/index.jelly @@ -55,8 +55,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/lib/hudson/artifactList.jelly b/core/src/main/resources/lib/hudson/artifactList.jelly index 446696db65d2..8bbfad67e1a7 100644 --- a/core/src/main/resources/lib/hudson/artifactList.jelly +++ b/core/src/main/resources/lib/hudson/artifactList.jelly @@ -38,7 +38,7 @@ THE SOFTWARE. If the hyperlink to artifacts are at another URL, specify the prefix. - +