From 9ead76e210a52cda65befe89e70355127ad3ff31 Mon Sep 17 00:00:00 2001 From: michael cirioli Date: Sat, 22 Feb 2020 10:28:42 -0500 Subject: [PATCH] =?UTF-8?q?[JEP-223]=20Deprecate=20permissions=20RUN=5FSCR?= =?UTF-8?q?IPTS,=20UPLOAD=5FPLUGINS,=20an=E2=80=A6=20(#4365)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jesse Glick Co-authored-by: Tim Jacomb Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com> --- core/src/main/java/hudson/PluginManager.java | 13 +++++++++---- core/src/main/java/hudson/cli/GroovyCommand.java | 2 +- core/src/main/java/hudson/cli/GroovyshCommand.java | 2 +- .../main/java/hudson/cli/InstallPluginCommand.java | 2 +- .../main/java/hudson/util/RemotingDiagnostics.java | 2 +- .../main/java/jenkins/management/ConsoleLink.java | 2 +- core/src/main/java/jenkins/model/Jenkins.java | 6 ++++-- .../jenkins/security/s2m/AdminWhitelistRule.java | 4 ++-- .../security/s2m/MasterKillSwitchConfiguration.java | 2 +- core/src/main/resources/hudson/Messages.properties | 5 ++--- .../main/resources/hudson/Messages_bg.properties | 7 ------- .../main/resources/hudson/Messages_de.properties | 4 ---- .../main/resources/hudson/Messages_fr.properties | 6 ------ .../main/resources/hudson/Messages_it.properties | 5 ----- .../main/resources/hudson/Messages_ja.properties | 4 ---- .../main/resources/hudson/Messages_pt.properties | 5 ----- .../main/resources/hudson/Messages_pt_BR.properties | 5 ----- .../main/resources/hudson/Messages_sr.properties | 2 -- .../main/resources/hudson/Messages_zh_TW.properties | 5 ----- .../resources/hudson/PluginManager/advanced.jelly | 7 +------ .../resources/hudson/PluginManager/tabBar.jelly | 2 -- .../resources/hudson/model/Computer/sidepanel.jelly | 2 +- .../main/resources/hudson/model/Messages.properties | 2 +- .../resources/hudson/model/Messages_bg.properties | 3 --- .../resources/hudson/model/Messages_de.properties | 3 --- .../resources/hudson/model/Messages_es.properties | 1 - .../resources/hudson/model/Messages_it.properties | 3 --- .../resources/hudson/model/Messages_ja.properties | 2 -- .../resources/hudson/model/Messages_lt.properties | 2 -- .../hudson/model/Messages_pt_BR.properties | 2 -- .../resources/hudson/model/Messages_sr.properties | 1 - .../hudson/model/Messages_zh_TW.properties | 2 -- .../security/s2m/AdminWhitelistRule/index.jelly | 2 +- .../main/resources/lib/hudson/scriptConsole.jelly | 2 +- .../test/java/hudson/cli/GroovyshCommandTest.java | 2 +- test/src/test/java/jenkins/model/JenkinsTest.java | 7 ++++--- 36 files changed, 33 insertions(+), 95 deletions(-) diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java index b2b8b585c6..a235146efc 100644 --- a/core/src/main/java/hudson/PluginManager.java +++ b/core/src/main/java/hudson/PluginManager.java @@ -1394,7 +1394,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas @RequirePOST public HttpResponse doUpdateSources(StaplerRequest req) throws IOException { - Jenkins.get().checkPermission(CONFIGURE_UPDATECENTER); + Jenkins.get().checkPermission(Jenkins.ADMINISTER); if (req.hasParameter("remove")) { UpdateCenter uc = Jenkins.get().getUpdateCenter(); @@ -1600,7 +1600,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas @RequirePOST public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Jenkins hudson = Jenkins.get(); - hudson.checkPermission(CONFIGURE_UPDATECENTER); + hudson.checkPermission(Jenkins.ADMINISTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList sites = uc.getSites(); for (UpdateSite s : sites) { @@ -1615,7 +1615,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas @POST public HttpResponse doProxyConfigure(StaplerRequest req) throws IOException, ServletException { Jenkins jenkins = Jenkins.get(); - jenkins.checkPermission(CONFIGURE_UPDATECENTER); + jenkins.checkPermission(Jenkins.ADMINISTER); ProxyConfiguration pc = req.bindJSON(ProxyConfiguration.class, req.getSubmittedForm()); if (pc.name==null) { @@ -1634,7 +1634,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas @RequirePOST public HttpResponse doUploadPlugin(StaplerRequest req) throws IOException, ServletException { try { - Jenkins.get().checkPermission(UPLOAD_PLUGINS); + Jenkins.get().checkPermission(Jenkins.ADMINISTER); ServletFileUpload upload = new ServletFileUpload(new DiskFileItemFactory()); @@ -2105,7 +2105,12 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas } public static boolean FAST_LOOKUP = !SystemProperties.getBoolean(PluginManager.class.getName()+".noFastLookup"); + /** @deprecated in Jenkins 2.222 use {@link Jenkins#ADMINISTER} instead */ + @Deprecated public static final Permission UPLOAD_PLUGINS = new Permission(Jenkins.PERMISSIONS, "UploadPlugins", Messages._PluginManager_UploadPluginsPermission_Description(),Jenkins.ADMINISTER,PermissionScope.JENKINS); + + /** @deprecated in Jenkins 2.222 use {@link Jenkins#ADMINISTER} instead */ + @Deprecated public static final Permission CONFIGURE_UPDATECENTER = new Permission(Jenkins.PERMISSIONS, "ConfigureUpdateCenter", Messages._PluginManager_ConfigureUpdateCenterPermission_Description(),Jenkins.ADMINISTER,PermissionScope.JENKINS); /** diff --git a/core/src/main/java/hudson/cli/GroovyCommand.java b/core/src/main/java/hudson/cli/GroovyCommand.java index 9a802bc5a1..8279f7ba4e 100644 --- a/core/src/main/java/hudson/cli/GroovyCommand.java +++ b/core/src/main/java/hudson/cli/GroovyCommand.java @@ -59,7 +59,7 @@ public class GroovyCommand extends CLICommand { protected int run() throws Exception { // this allows the caller to manipulate the JVM state, so require the execute script privilege. - Jenkins.get().checkPermission(Jenkins.RUN_SCRIPTS); + Jenkins.get().checkPermission(Jenkins.ADMINISTER); Binding binding = new Binding(); binding.setProperty("out",new PrintWriter(stdout,true)); diff --git a/core/src/main/java/hudson/cli/GroovyshCommand.java b/core/src/main/java/hudson/cli/GroovyshCommand.java index dd2584ebf0..c8255f6456 100644 --- a/core/src/main/java/hudson/cli/GroovyshCommand.java +++ b/core/src/main/java/hudson/cli/GroovyshCommand.java @@ -60,7 +60,7 @@ public class GroovyshCommand extends CLICommand { @Override protected int run() { // this allows the caller to manipulate the JVM state, so require the admin privilege. - Jenkins.get().checkPermission(Jenkins.RUN_SCRIPTS); + Jenkins.get().checkPermission(Jenkins.ADMINISTER); // this being remote means no jline capability is available System.setProperty("jline.terminal", UnsupportedTerminal.class.getName()); diff --git a/core/src/main/java/hudson/cli/InstallPluginCommand.java b/core/src/main/java/hudson/cli/InstallPluginCommand.java index 09cb54c95c..7b5985c75e 100644 --- a/core/src/main/java/hudson/cli/InstallPluginCommand.java +++ b/core/src/main/java/hudson/cli/InstallPluginCommand.java @@ -83,7 +83,7 @@ public class InstallPluginCommand extends CLICommand { @Override protected int run() throws Exception { Jenkins h = Jenkins.get(); - h.checkPermission(PluginManager.UPLOAD_PLUGINS); + h.checkPermission(Jenkins.ADMINISTER); PluginManager pm = h.getPluginManager(); if (name != null) { diff --git a/core/src/main/java/hudson/util/RemotingDiagnostics.java b/core/src/main/java/hudson/util/RemotingDiagnostics.java index ec341b3bef..bac1a86e28 100644 --- a/core/src/main/java/hudson/util/RemotingDiagnostics.java +++ b/core/src/main/java/hudson/util/RemotingDiagnostics.java @@ -196,7 +196,7 @@ public final class RemotingDiagnostics { @WebMethod(name="heapdump.hprof") public void doHeapDump(StaplerRequest req, StaplerResponse rsp) throws IOException, InterruptedException { - owner.checkPermission(Jenkins.RUN_SCRIPTS); + owner.checkPermission(Jenkins.ADMINISTER); rsp.setContentType("application/octet-stream"); FilePath dump = obtain(); diff --git a/core/src/main/java/jenkins/management/ConsoleLink.java b/core/src/main/java/jenkins/management/ConsoleLink.java index edd7c628cc..c51a10dc1a 100644 --- a/core/src/main/java/jenkins/management/ConsoleLink.java +++ b/core/src/main/java/jenkins/management/ConsoleLink.java @@ -57,6 +57,6 @@ public class ConsoleLink extends ManagementLink { @Override public Permission getRequiredPermission() { - return Jenkins.RUN_SCRIPTS; + return Jenkins.ADMINISTER; } } diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 0ffbb798b2..be29e6f85b 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -4463,7 +4463,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve */ public static void _doScript(StaplerRequest req, StaplerResponse rsp, RequestDispatcher view, VirtualChannel channel, ACL acl) throws IOException, ServletException { // ability to run arbitrary script is dangerous - acl.checkPermission(RUN_SCRIPTS); + acl.checkPermission(ADMINISTER); String text = req.getParameter("script"); if (text != null) { @@ -4493,7 +4493,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve */ @RequirePOST public void doEval(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { - checkPermission(RUN_SCRIPTS); + checkPermission(ADMINISTER); req.getWebApp().getDispatchValidator().allowDispatch(req, rsp); try { MetaClass mc = req.getWebApp().getMetaClass(getClass()); @@ -5282,6 +5282,8 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve new Permission[] { MANAGE, SYSTEM_READ }; public static final Permission READ = new Permission(PERMISSIONS,"Read",Messages._Hudson_ReadPermission_Description(),Permission.READ,PermissionScope.JENKINS); + /** @deprecated in Jenkins 2.222 use {@link Jenkins#ADMINISTER} instead */ + @Deprecated public static final Permission RUN_SCRIPTS = new Permission(PERMISSIONS, "RunScripts", Messages._Hudson_RunScriptsPermission_Description(),ADMINISTER,PermissionScope.JENKINS); /** diff --git a/core/src/main/java/jenkins/security/s2m/AdminWhitelistRule.java b/core/src/main/java/jenkins/security/s2m/AdminWhitelistRule.java index 36d7f1881e..5ee224e30e 100644 --- a/core/src/main/java/jenkins/security/s2m/AdminWhitelistRule.java +++ b/core/src/main/java/jenkins/security/s2m/AdminWhitelistRule.java @@ -212,7 +212,7 @@ public class AdminWhitelistRule implements StaplerProxy { public void setMasterKillSwitch(boolean state) { final Jenkins jenkins = Jenkins.get(); try { - jenkins.checkPermission(Jenkins.RUN_SCRIPTS); + jenkins.checkPermission(Jenkins.ADMINISTER); File f = getMasterKillSwitchFile(jenkins); FileUtils.writeStringToFile(f, Boolean.toString(state), Charset.defaultCharset()); // treat the file as the canonical source of information in case write fails @@ -227,7 +227,7 @@ public class AdminWhitelistRule implements StaplerProxy { */ @Override public Object getTarget() { - Jenkins.get().checkPermission(Jenkins.RUN_SCRIPTS); + Jenkins.get().checkPermission(Jenkins.ADMINISTER); return this; } diff --git a/core/src/main/java/jenkins/security/s2m/MasterKillSwitchConfiguration.java b/core/src/main/java/jenkins/security/s2m/MasterKillSwitchConfiguration.java index 66e20fdd22..f531b31f8a 100644 --- a/core/src/main/java/jenkins/security/s2m/MasterKillSwitchConfiguration.java +++ b/core/src/main/java/jenkins/security/s2m/MasterKillSwitchConfiguration.java @@ -48,7 +48,7 @@ public class MasterKillSwitchConfiguration extends GlobalConfiguration { * Unless this option is relevant, we don't let users choose this. */ public boolean isRelevant() { - return jenkins.hasPermission(Jenkins.RUN_SCRIPTS) && jenkins.isUseSecurity(); + return jenkins.hasPermission(Jenkins.ADMINISTER) && jenkins.isUseSecurity(); } } diff --git a/core/src/main/resources/hudson/Messages.properties b/core/src/main/resources/hudson/Messages.properties index 79fb95b90f..109bcdeb4f 100644 --- a/core/src/main/resources/hudson/Messages.properties +++ b/core/src/main/resources/hudson/Messages.properties @@ -53,10 +53,9 @@ PluginManager.DisplayName=Plugin Manager PluginManager.PortNotANumber=Port is not a number PluginManager.PortNotInRange=Port doesn\u2019t range from {0} to {1} PluginManager.UploadPluginsPermission.Description=\ - The "upload plugin" permission allows a user to upload arbitrary plugins. + Deprecated - Please use the Overall/Administer permission instead PluginManager.ConfigureUpdateCenterPermission.Description=\ - The "configure update center" permission allows a user to \ - configure update sites and proxy settings. + Deprecated - Please use the Overall/Administer permission instead PluginManager.PluginCycleDependenciesMonitor.DisplayName=Cyclic Dependencies Detector PluginManager.PluginUpdateMonitor.DisplayName=Invalid Plugin Configuration PluginManager.CheckUpdateServerError=There were errors checking the update sites: {0} diff --git a/core/src/main/resources/hudson/Messages_bg.properties b/core/src/main/resources/hudson/Messages_bg.properties index 21ae9508d1..ebfc064d92 100644 --- a/core/src/main/resources/hudson/Messages_bg.properties +++ b/core/src/main/resources/hudson/Messages_bg.properties @@ -78,13 +78,6 @@ PluginManager.PortNotANumber=\ \u0421\u0442\u043e\u0439\u043d\u043e\u0441\u0442\u0442\u0430 \u0437\u0430 \u043f\u043e\u0440\u0442\u0430 \u0442\u0440\u044f\u0431\u0432\u0430 \u0434\u0430 \u0435 \u0447\u0438\u0441\u043b\u043e PluginManager.PortNotInRange=\ \u0421\u0442\u043e\u0439\u043d\u043e\u0441\u0442\u0442\u0430 \u0437\u0430 \u043f\u043e\u0440\u0442\u0430 \u0442\u0440\u044f\u0431\u0432\u0430 \u0434\u0430 \u0435 \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 [{0}; {1}] -PluginManager.UploadPluginsPermission.Description=\ - \u041f\u0440\u0430\u0432\u043e\u0442\u043e \u0437\u0430 \u043a\u0430\u0447\u0432\u0430\u043d\u0435 \u043d\u0430 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u0430\u0432\u0430 \u0432\u044a\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442 \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044f \u0434\u0430 \u043a\u0430\u0447\u0438\ - \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u043d\u0430 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0430. -PluginManager.ConfigureUpdateCenterPermission.Description=\ - \u041f\u0440\u0430\u0432\u043e\u0442\u043e \u0437\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0432\u0430\u043d\u0435 \u0434\u0430\u0432\u0430 \u0432\u044a\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442 \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044f \u0434\u0430 \u043f\u0440\u043e\u043c\u0435\u043d\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u0442\u0435\ - \u043d\u0430 \u0441\u0430\u0439\u0442\u043e\u0432\u0435\u0442\u0435 \u0438 \u0441\u044a\u0440\u0432\u044a\u0440\u0430-\u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a. - AboutJenkins.DisplayName=\ \u041e\u0442\u043d\u043e\u0441\u043d\u043e Jenkins AboutJenkins.Description=\ diff --git a/core/src/main/resources/hudson/Messages_de.properties b/core/src/main/resources/hudson/Messages_de.properties index 0ea2204285..6be68c5028 100644 --- a/core/src/main/resources/hudson/Messages_de.properties +++ b/core/src/main/resources/hudson/Messages_de.properties @@ -54,10 +54,6 @@ FilePath.validateAntFileMask.whitespaceSeparator=Leerzeichen k\u00F6nnen nicht m PluginManager.DisplayName=Plugins verwalten PluginManager.PortNotANumber=Port ist keine Zahl PluginManager.PortNotInRange=Port ist keine Zahl zwischen {0} und {1,number,#} -PluginManager.UploadPluginsPermission.Description=\ - Dieses Recht erlaubt, beliebige Plugins hochzuladen. -PluginManager.ConfigureUpdateCenterPermission.Description=\ - Dieses Recht ist notwendig, um Aktualisierungsserver und Proxy-Einstellungen zu konfigurieren. PluginManager.PluginCycleDependenciesMonitor.DisplayName=Erkennung zyklischer Abh\u00E4ngigkeiten PluginManager.PluginUpdateMonitor.DisplayName=Ung\u00FCltige Plugin-Konfiguration diff --git a/core/src/main/resources/hudson/Messages_fr.properties b/core/src/main/resources/hudson/Messages_fr.properties index 148321a271..3c889832cb 100644 --- a/core/src/main/resources/hudson/Messages_fr.properties +++ b/core/src/main/resources/hudson/Messages_fr.properties @@ -51,12 +51,6 @@ FilePath.TildaDoesntWork=''~'' n''est support\u00e9 que sur les shells Unix. PluginManager.DisplayName=Gestion des plugins PluginManager.PortNotANumber=Le port n''est pas un nombre PluginManager.PortNotInRange=Le port n''est pas dans l''intervalle de {0} \u00e0 {1} -PluginManager.UploadPluginsPermission.Description=\ - La permission "upload plugin" autorise un utilisateur \u00e0 uploader des plugins. -PluginManager.ConfigureUpdateCenterPermission.Description=\ - La permission "configure update center" autorise un utilisateur \u00e0 \ - configurer les sites de mise \u00e0 jour et le param\u00e9trage du proxy. - AboutJenkins.DisplayName=A propos de Jenkins AboutJenkins.Description=Afficher les informations de version et de licence diff --git a/core/src/main/resources/hudson/Messages_it.properties b/core/src/main/resources/hudson/Messages_it.properties index 1263c764ec..4f411aba4d 100644 --- a/core/src/main/resources/hudson/Messages_it.properties +++ b/core/src/main/resources/hudson/Messages_it.properties @@ -30,11 +30,6 @@ FilePath.TildaDoesntWork="~" PluginManager.DisplayName=Gestore plugin PluginManager.PortNotANumber=La porta non è un numero PluginManager.PortNotInRange=La porta non è compresa nell''intervallo da {0} a {1} -PluginManager.UploadPluginsPermission.Description=\ - Il permesso "Carica plugin" consente a un utente di caricare plugin arbitrari. -PluginManager.ConfigureUpdateCenterPermission.Description=\ - Il permesso "Configura Centro aggiornamenti" consente a un utente di \ - configurare le impostazioni dei siti di aggiornamento e del proxy. PluginManager.PluginCycleDependenciesMonitor.DisplayName=Rilevatore dipendenze cicliche PluginManager.PluginUpdateMonitor.DisplayName=Configurazione plugin non valida diff --git a/core/src/main/resources/hudson/Messages_ja.properties b/core/src/main/resources/hudson/Messages_ja.properties index 98186ca534..f7520dd494 100644 --- a/core/src/main/resources/hudson/Messages_ja.properties +++ b/core/src/main/resources/hudson/Messages_ja.properties @@ -56,10 +56,6 @@ FilePath.TildaDoesntWork=''~'' \u306f\u3001Unix\u306e\u30b7\u30a7\u30eb\u3067\u3 PluginManager.DisplayName=\u30d7\u30e9\u30b0\u30a4\u30f3\u30de\u30cd\u30fc\u30b8\u30e3\u30fc PluginManager.PortNotANumber=\u30dd\u30fc\u30c8\u756a\u53f7\u304c\u6570\u5b57\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 PluginManager.PortNotInRange=\u30dd\u30fc\u30c8\u756a\u53f7\u304c{0}\u304b\u3089{1}\u307e\u3067\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 -PluginManager.UploadPluginsPermission.Description=\ - \u6a29\u9650"\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9"\u304c\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3092\u8a31\u53ef\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 -PluginManager.ConfigureUpdateCenterPermission.Description=\ - \u6a29\u9650"\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u30bb\u30f3\u30bf\u30fc\u306e\u66f4\u65b0"\u304c\u3001\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u30b5\u30a4\u30c8\u3084\u30d7\u30ed\u30ad\u30b7\u30fc\u306e\u8a2d\u5b9a\u3092\u8a31\u53ef\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 AboutJenkins.DisplayName=Jenkins\u306b\u3064\u3044\u3066 AboutJenkins.Description=\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u30e9\u30a4\u30bb\u30f3\u30b9\u60c5\u5831\u3092\u8868\u793a\u3057\u307e\u3059\u3002 diff --git a/core/src/main/resources/hudson/Messages_pt.properties b/core/src/main/resources/hudson/Messages_pt.properties index 5f3a1d51a8..fb0d9e888b 100644 --- a/core/src/main/resources/hudson/Messages_pt.properties +++ b/core/src/main/resources/hudson/Messages_pt.properties @@ -32,12 +32,7 @@ Util.year={0} yr FilePath.validateRelativePath.notDirectory=\u2018{0}\u2019 n\u00e3o \u00e9 um diret\u00f3rio PluginManager.PortNotANumber=Porta n\u00e3o \u00e9 um n\u00famero FilePath.validateRelativePath.noSuchFile=Arquivo n\u00e3o existe: \u2018{0}\u2019 -PluginManager.ConfigureUpdateCenterPermission.Description=\ - A permissao "configurar a central de atualiza\u00e7\u00f5es" permite o \ - usu\u00e1rio configurar sites de atualiza\u00e7\u00e3o e configura\u00e7\u00f5es de proxy. FilePath.validateAntFileMask.portionMatchButPreviousNotMatchAndSuggest=\u2018{0}\u2019 n\u00e3o corresponde a nenhum: \u2018{1}\u2019 existe mas n\u00e3o \u2018{2}\u2019 -PluginManager.UploadPluginsPermission.Description= \ - A permiss\u00e3o de "upload plugin" permite ao usu\u00e1rio fazer upload de qualquer plugin. PluginManager.DisplayName=Gerenciados de plugins FilePath.validateRelativePath.noSuchDirectory=N\u00e3o existe o diret\u00f3rio: \u2018{0}\u2019 Util.millisecond={0} ms diff --git a/core/src/main/resources/hudson/Messages_pt_BR.properties b/core/src/main/resources/hudson/Messages_pt_BR.properties index ab9343b020..4e1d3d0d80 100644 --- a/core/src/main/resources/hudson/Messages_pt_BR.properties +++ b/core/src/main/resources/hudson/Messages_pt_BR.properties @@ -61,11 +61,6 @@ Util.year ={0} {0,choice,0#anos|1#ano|1 -

${%HTTP Proxy Configuration}

@@ -47,9 +46,7 @@ THE SOFTWARE. -
-

${%Upload Plugin}

@@ -65,8 +62,7 @@ THE SOFTWARE. -
- +

${%Update Site}

@@ -92,7 +88,6 @@ THE SOFTWARE. -
diff --git a/core/src/main/resources/hudson/PluginManager/tabBar.jelly b/core/src/main/resources/hudson/PluginManager/tabBar.jelly index f29d556105..8109281b4a 100644 --- a/core/src/main/resources/hudson/PluginManager/tabBar.jelly +++ b/core/src/main/resources/hudson/PluginManager/tabBar.jelly @@ -31,8 +31,6 @@ THE SOFTWARE. - - diff --git a/core/src/main/resources/hudson/model/Computer/sidepanel.jelly b/core/src/main/resources/hudson/model/Computer/sidepanel.jelly index d3c30c47a1..5e2958ee3f 100644 --- a/core/src/main/resources/hudson/model/Computer/sidepanel.jelly +++ b/core/src/main/resources/hudson/model/Computer/sidepanel.jelly @@ -37,7 +37,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/hudson/model/Messages.properties b/core/src/main/resources/hudson/model/Messages.properties index ad9fbce469..2f8f88c54b 100644 --- a/core/src/main/resources/hudson/model/Messages.properties +++ b/core/src/main/resources/hudson/model/Messages.properties @@ -174,7 +174,7 @@ Hudson.ReadPermission.Description=\ Jenkins pages: revoke this permission from the anonymous user, then \ add "authenticated" pseudo-user and grant the read access. Hudson.RunScriptsPermission.Description=\ - Required for running scripts inside the Jenkins process, for example via the Groovy console or Groovy CLI command. + Deprecated - please use the Overall/Administer permission instead Hudson.NodeDescription=the master Jenkins node Item.Permissions.Title=Job diff --git a/core/src/main/resources/hudson/model/Messages_bg.properties b/core/src/main/resources/hudson/model/Messages_bg.properties index dc32dc706e..b84d6a891d 100644 --- a/core/src/main/resources/hudson/model/Messages_bg.properties +++ b/core/src/main/resources/hudson/model/Messages_bg.properties @@ -232,9 +232,6 @@ Hudson.ReadPermission.Description=\ \u0438\u0441\u043a\u0430\u0442\u0435 \u043d\u0435\u043f\u043e\u0437\u043d\u0430\u0442\u0438\u0442\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438 \u0434\u0430 \u0432\u0438\u0436\u0434\u0430\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0438\u0442\u0435 \u043d\u0430 Jenkins, \u043e\u0442\u043d\u0435\u043c\u0435\u0442\u0435 \u0442\u043e\u0432\u0430\ \u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u0438\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b (\u201eanonymous\u201c) \u0438 \u0433\u043e \u0434\u0430\u0439\u0442\u0435 \u043d\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0430\u043b\u0438\u0442\u0435 \u0441\u0435\ \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438 (\u201eauthenticated\u201c). -Hudson.RunScriptsPermission.Description=\ - \u0422\u043e\u0432\u0430 \u0434\u0430\u0432\u0430 \u043f\u0440\u0430\u0432\u043e \u0437\u0430 \u0438\u0437\u043f\u044a\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0435 \u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0430 \u043d\u0430 \u043f\u0440\u0435\u0437 \u043a\u043e\u043d\u0437\u043e\u043b\u0430\u0442\u0430 \u043d\u0430\ - Groovy \u0438\u043b\u0438 \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0438\u0442\u0435 \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0438\u044f \u0440\u0435\u0434. Hudson.NodeDescription=\ \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0432\u0430\u0449\u0438\u044f\u0442 \u043a\u043e\u043c\u043f\u044e\u0442\u044a\u0440 \u043d\u0430 Jenkins diff --git a/core/src/main/resources/hudson/model/Messages_de.properties b/core/src/main/resources/hudson/model/Messages_de.properties index 70cd593b8b..2a8b67fac4 100644 --- a/core/src/main/resources/hudson/model/Messages_de.properties +++ b/core/src/main/resources/hudson/model/Messages_de.properties @@ -156,9 +156,6 @@ Hudson.ReadPermission.Description=\ auf Jenkins-Seiten verweigern m\u00F6chten — entziehen Sie dazu dem Benutzer \ anonymous dieses Recht, f\u00FCgen Sie dann einen Pseudo-Benutzer \u201Eauthenticated\u201C hinzu \ und erteilen Sie diesem Lese-Zugriff. -Hudson.RunScriptsPermission.Description=\ - Dieses Recht ist notwendig, um Skripte innerhalb des Jenkins-Prozesses auszuf\u00FChren, \ - z.B. Groovy-Skripte \u00FCber die Skript-Konsole oder das Groovy CLI. Hudson.NodeDescription=Jenkins Master-Knoten Item.Permissions.Title=Element diff --git a/core/src/main/resources/hudson/model/Messages_es.properties b/core/src/main/resources/hudson/model/Messages_es.properties index 91f9d7e1ed..39335a749f 100644 --- a/core/src/main/resources/hudson/model/Messages_es.properties +++ b/core/src/main/resources/hudson/model/Messages_es.properties @@ -276,7 +276,6 @@ Computer.DisconnectPermission.Description=Este permiso permite que los usuarios Computer.CreatePermission.Description=Este permiso permite que los usuarios puedan crear nuevos nodos. ResultTrend.StillUnstable=Todav\u00EDa inestable View.ReadPermission.Description=Este permiso permite que los usuarion puedan crear vistas (implica acceso de lectura) -Hudson.RunScriptsPermission.Description=El permiso "run scripts' es necesario para ejecutar scripts de groovy usando la consola groovy o el "cli" de groovy. ResultTrend.Fixed=Arreglado ResultTrend.Failure=Fallo UpdateCenter.PluginCategory.listview-column=Columnas de la lista diff --git a/core/src/main/resources/hudson/model/Messages_it.properties b/core/src/main/resources/hudson/model/Messages_it.properties index c009c0f344..afc3dac8d5 100644 --- a/core/src/main/resources/hudson/model/Messages_it.properties +++ b/core/src/main/resources/hudson/model/Messages_it.properties @@ -165,9 +165,6 @@ Hudson.ReadPermission.Description=\ Questo permesso è utile nel caso in cui non si voglia che utenti non autenticati visualizzino \ le pagine di Jenkins: si revochi questo permesso all''utente anonimo, quindi si aggiunga uno \ pseudoutente "autenticato" e si conceda l''accesso in lettura. -Hudson.RunScriptsPermission.Description=\ - Richiesto per l''esecuzione di script nel processo Jenkins, ad esempio tramite la console Groovy o il comando \ - Groovy dall''interfaccia da riga di comando. Hudson.NodeDescription=il nodo master Jenkins Item.Permissions.Title=Processo diff --git a/core/src/main/resources/hudson/model/Messages_ja.properties b/core/src/main/resources/hudson/model/Messages_ja.properties index d26b03892d..141d0a8db0 100644 --- a/core/src/main/resources/hudson/model/Messages_ja.properties +++ b/core/src/main/resources/hudson/model/Messages_ja.properties @@ -124,8 +124,6 @@ Hudson.ReadPermission.Description=\ \u53c2\u7167\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u306f\u3001Jenkins\u306e\u307b\u307c\u3059\u3079\u3066\u306e\u753b\u9762\u3092\u53c2\u7167\u3059\u308b\u306e\u306b\u5fc5\u8981\u3067\u3059\u3002\ \u3053\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u306f\u3001\u8a8d\u8a3c\u3055\u308c\u3066\u3044\u306a\u3044\u30e6\u30fc\u30b6\u30fc\u306b\u306fJenkins\u306e\u753b\u9762\u3092\u53c2\u7167\u3055\u305b\u305f\u304f\u306a\u3044\u5834\u5408\u306b\u4fbf\u5229\u3067\u3059\u3002\ — \u533f\u540d\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u3053\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u524a\u9664\u5f8c\u3001"\u8a8d\u8a3c\u6e08\u307f"\u306e\u65e2\u5b58\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u52a0\u3057\u3066\u53c2\u7167\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002 -Hudson.RunScriptsPermission.Description=\ - Groovy\u30b3\u30f3\u30bd\u30fc\u30eb\u3084CLI\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u305fGroovy\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002 Hudson.NodeDescription=\u30ce\u30fc\u30c9 Item.Permissions.Title=\u30b8\u30e7\u30d6 diff --git a/core/src/main/resources/hudson/model/Messages_lt.properties b/core/src/main/resources/hudson/model/Messages_lt.properties index e1786a842a..872ff3bb2d 100644 --- a/core/src/main/resources/hudson/model/Messages_lt.properties +++ b/core/src/main/resources/hudson/model/Messages_lt.properties @@ -132,8 +132,6 @@ Hudson.ReadPermission.Description=\ \u0160ios teis\u0117s naudingos, jei j\u016bs nenorite, kad neautentikuoti naudotojai matyt\u0173 \ Jenkinso puslapius: atimkite \u0161ias teises i\u0161 anoniminio naudotojo, tada \ prid\u0117kite pseaudo-naudotoj\u0105 \u201eauthenticated\u201c ir duokite jam skaitymo teises. -Hudson.RunScriptsPermission.Description=\ - Reikia skript\u0173 paleidim\u0173 Jenkinso procese, pavyzd\u017eiui per Groovy konsol\u0119 arba Groovy CLI komand\u0105. Hudson.NodeDescription=Pagrindinis Jenkinso mazgas Item.Permissions.Title=Darbas diff --git a/core/src/main/resources/hudson/model/Messages_pt_BR.properties b/core/src/main/resources/hudson/model/Messages_pt_BR.properties index ebdc773941..66e43868b8 100644 --- a/core/src/main/resources/hudson/model/Messages_pt_BR.properties +++ b/core/src/main/resources/hudson/model/Messages_pt_BR.properties @@ -398,8 +398,6 @@ ResultTrend.Success=Sucesso UpdateCenter.n_a=N/D # Fixed ResultTrend.Fixed=Resolvido -# Required for running scripts inside the Jenkins process, for example via the Groovy console or Groovy CLI command. -Hudson.RunScriptsPermission.Description=Necess\u00e1rio para executar scripts dentro de um processo no Jenkins, por exemplo via console Groovy ou comando Groovy pelo CLI. # Now unstable ResultTrend.NowUnstable=Inst\u00e1vel agora # Unstable diff --git a/core/src/main/resources/hudson/model/Messages_sr.properties b/core/src/main/resources/hudson/model/Messages_sr.properties index 3d6a308916..665ce94163 100644 --- a/core/src/main/resources/hudson/model/Messages_sr.properties +++ b/core/src/main/resources/hudson/model/Messages_sr.properties @@ -119,7 +119,6 @@ Hudson.NotUsesUTF8ToDecodeURL=URL \u0430\u0434\u0440\u0435\u0441\u0435 \u0432\u0 Tomcat i18n. Hudson.AdministerPermission.Description=\u0414\u0430\u0458\u0435 \u043F\u0440\u0430\u0432\u043E \u0434\u0430 \u043C\u0435\u045A\u0430 \u043F\u043E\u0434\u0435\u0448\u0430\u0432\u0430\u045A\u0430 \u0441\u0438\u0441\u0442\u0435\u043C\u0430, \u043A\u0430\u043E \u0438 \u043A\u043E\u043C\u043F\u043B\u0435\u0442\u0430\u043D \u043F\u0440\u0438\u0441\u0442\u0443\u043F \u043B\u043E\u043A\u0430\u043B\u043D\u043E\u0433 \u0441\u0438\u0441\u0442\u0435\u043C\u0430 \u0434\u0430\u0442\u043E\u0442\u0435\u043A\u0430 \u0443 \u0458\u0435\u0434\u043D\u0430\u043A\u0435 \u043F\u043E \u043E\u043A\u0432\u0438\u0440\u0443 \u043F\u0440\u0430\u0432\u0430 \u0443 \u0441\u043A\u043B\u0430\u0434\u0443 \u0441\u0430 \u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u043D\u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u043E\u043C. Hudson.ReadPermission.Description= -Hudson.RunScriptsPermission.Description=\u041E\u0431\u0430\u0432\u0435\u0437\u043D\u043E \u0437\u0430 \u0438\u0437\u0432\u0440\u0448\u0430\u0432\u0430\u045A\u0435 \u0441\u043A\u0440\u0438\u043F\u0442\u0430 \u0443\u043D\u0443\u0442\u0430\u0440 Jenkins \u043F\u0440\u043E\u0446\u0435\u0441\u0430, \u043A\u0430\u043E \u043D\u0430 \u043F\u0440\u0438\u043C\u0435\u0440 \u043F\u0440\u0435\u043A\u043E Groovy \u043A\u043E\u043D\u0441\u043E\u043B\u0435 \u0438\u043B\u0438 \u043A\u043E\u043C\u0430\u043D\u0434\u0435. Hudson.NodeDescription=\u0433\u043B\u0430\u0432\u043D\u0430 Jenkins \u043C\u0430\u0448\u0438\u043D\u0430 Item.CREATE.description=\u041A\u0440\u0435\u0438\u0440\u0430\u0458 \u043D\u043E\u0432\u0438 \u0437\u0430\u0434\u0430\u0442\u0430\u043A Item.Permissions.Title=\u0417\u0430\u0434\u0430\u0442\u0430\u043A diff --git a/core/src/main/resources/hudson/model/Messages_zh_TW.properties b/core/src/main/resources/hudson/model/Messages_zh_TW.properties index a2ef8a6b54..7655547d2d 100644 --- a/core/src/main/resources/hudson/model/Messages_zh_TW.properties +++ b/core/src/main/resources/hudson/model/Messages_zh_TW.properties @@ -126,8 +126,6 @@ Hudson.ReadPermission.Description=\ \u6709\u8b80\u53d6\u6b0a\u9650\u624d\u80fd\u770b\u5230 Jenkins \u7684\u5927\u90e8\u5206\u7db2\u9801\u3002\ \u5982\u679c\u60a8\u4e0d\u60f3\u8b93\u6c92\u901a\u904e\u9a57\u8b49\u7684\u4f7f\u7528\u8005\u770b\u5230 Jenkins \u7db2\u9801\uff0c\u8acb\u64a4\u92b7 anonymous \u4f7f\u7528\u8005\u7684\u6b0a\u9650\uff0c\ \u518d\u65b0\u589e "authenticated" \u865b\u64ec\u4f7f\u7528\u8005\uff0c\u4e26\u6388\u8207\u8b80\u53d6\u6b0a\u9650\u3002 -Hudson.RunScriptsPermission.Description=\ - \u6709 "run scripts" \u6b0a\u9650\u624d\u80fd\u900f\u904e Groovy \u4e3b\u63a7\u53f0\u6216\u662f Groovy CLI \u6307\u4ee4\u57f7\u884c Groovy Script\u3002 Hudson.NodeDescription=Jenkins \u4e3b\u7bc0\u9ede Item.Permissions.Title=\u4f5c\u696d diff --git a/core/src/main/resources/jenkins/security/s2m/AdminWhitelistRule/index.jelly b/core/src/main/resources/jenkins/security/s2m/AdminWhitelistRule/index.jelly index 19dba8c4b9..fc1dbcce30 100644 --- a/core/src/main/resources/jenkins/security/s2m/AdminWhitelistRule/index.jelly +++ b/core/src/main/resources/jenkins/security/s2m/AdminWhitelistRule/index.jelly @@ -23,7 +23,7 @@ THE SOFTWARE. --> - +

${%Agent → Master Access Control}

diff --git a/core/src/main/resources/lib/hudson/scriptConsole.jelly b/core/src/main/resources/lib/hudson/scriptConsole.jelly index a0d24b32e0..494dc6c516 100644 --- a/core/src/main/resources/lib/hudson/scriptConsole.jelly +++ b/core/src/main/resources/lib/hudson/scriptConsole.jelly @@ -27,7 +27,7 @@ THE SOFTWARE. --> - + diff --git a/test/src/test/java/hudson/cli/GroovyshCommandTest.java b/test/src/test/java/hudson/cli/GroovyshCommandTest.java index eb61043593..cc7966c3e8 100644 --- a/test/src/test/java/hudson/cli/GroovyshCommandTest.java +++ b/test/src/test/java/hudson/cli/GroovyshCommandTest.java @@ -41,7 +41,7 @@ public class GroovyshCommandTest { @Issue("JENKINS-17929") @Test public void authentication() throws Exception { CLICommandInvoker.Result result = new CLICommandInvoker(r, new GroovyshCommand()) - .authorizedTo(Jenkins.READ, Jenkins.RUN_SCRIPTS) + .authorizedTo(Jenkins.READ, Jenkins.ADMINISTER) .withStdin(new StringInputStream("println(jenkins.model.Jenkins.instance.getClass().name)\n:quit\n")) .invoke(); assertThat(result, succeeded()); diff --git a/test/src/test/java/jenkins/model/JenkinsTest.java b/test/src/test/java/jenkins/model/JenkinsTest.java index 6addc51eb3..2678ea3fe9 100644 --- a/test/src/test/java/jenkins/model/JenkinsTest.java +++ b/test/src/test/java/jenkins/model/JenkinsTest.java @@ -299,7 +299,7 @@ public class JenkinsTest { j.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy(). grant(Jenkins.ADMINISTER).everywhere().to("alice"). grant(Jenkins.READ).everywhere().to("bob"). - grantWithoutImplication(Jenkins.ADMINISTER, Jenkins.READ).everywhere().to("charlie")); + grantWithoutImplication(Jenkins.RUN_SCRIPTS, Jenkins.READ).everywhere().to("charlie")); WebClient wc = j.createWebClient(); wc.withBasicApiToken(User.getById("alice", true)); @@ -317,6 +317,7 @@ public class JenkinsTest { wc.withBasicApiToken(User.getById("bob", true)); wc.assertFails("script", HttpURLConnection.HTTP_FORBIDDEN); + //TODO: remove once RUN_SCRIPTS is finally retired wc.withBasicApiToken(User.getById("charlie", true)); wc.assertFails("script", HttpURLConnection.HTTP_FORBIDDEN); } @@ -355,8 +356,8 @@ public class JenkinsTest { wc.withBasicApiToken(User.getById("charlie", true)); page = eval(wc); - assertEquals("charlie has ADMINISTER but not RUN_SCRIPTS", - HttpURLConnection.HTTP_FORBIDDEN, + assertEquals("charlie has ADMINISTER and READ", + HttpURLConnection.HTTP_OK, page.getWebResponse().getStatusCode()); } private Page eval(WebClient wc) throws Exception {