Merge branch '2.0'

2.1 will come from the master branch going forward
This commit is contained in:
Kohsuke Kawaguchi committed 2016-04-20 20:55:12 -07:00
commit 8cb24b6c13
13 files changed
+32 -7

No files matched your search

@@ -994,6 +994,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
*/
@Restricted(DoNotUse.class) // WebOnly
public HttpResponse doPlugins() {
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
JSONArray response = new JSONArray();
Map<String,JSONObject> allPlugins = new HashMap<>();
for (PluginWrapper plugin : plugins) {
@@ -1059,6 +1060,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
* Performs the installation of the plugins.
*/
public void doInstall(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
Set<String> plugins = new LinkedHashSet<>();
Enumeration<String> en = req.getParameterNames();
@@ -1087,6 +1089,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
@RequirePOST
@Restricted(DoNotUse.class) // WebOnly
public HttpResponse doInstallPlugins(StaplerRequest req) throws IOException {
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
String payload = IOUtils.toString(req.getInputStream(), req.getCharacterEncoding());
JSONObject request = JSONObject.fromObject(payload);
JSONArray pluginListJSON = request.getJSONArray("plugins");
@@ -1119,6 +1122,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
* @return The install job list.
* @since FIXME
*/
@Restricted(NoExternalUse.class)
public List<Future<UpdateCenter.UpdateCenterJob>> install(@Nonnull Collection<String> plugins, boolean dynamicLoad) {
return install(plugins, dynamicLoad, null);
}