mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-04 07:35:53 +00:00
Introduce PluginManager.UPLOAD_PLUGINS permission which allows a user to upload arbitrary plugins.
This commit is contained in:
1 parent
0e12fe4e74
commit
2ebf332b08
3 files changed
+11
-3
No files matched your search
@@ -34,6 +34,8 @@ import hudson.model.Descriptor;
|
||||
import hudson.model.Failure;
|
||||
import hudson.model.UpdateCenter;
|
||||
import hudson.model.UpdateSite;
|
||||
import hudson.security.Permission;
|
||||
import hudson.security.PermissionScope;
|
||||
import hudson.util.CyclicGraphDetector;
|
||||
import hudson.util.CyclicGraphDetector.CycleDetectedException;
|
||||
import hudson.util.IOException2;
|
||||
@@ -689,7 +691,7 @@ public abstract class PluginManager extends AbstractModelObject {
|
||||
*/
|
||||
public HttpResponse doUploadPlugin(StaplerRequest req) throws IOException, ServletException {
|
||||
try {
|
||||
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
|
||||
Jenkins.getInstance().checkPermission(UPLOAD_PLUGINS);
|
||||
|
||||
ServletFileUpload upload = new ServletFileUpload(new DiskFileItemFactory());
|
||||
|
||||
@@ -830,7 +832,9 @@ public abstract class PluginManager extends AbstractModelObject {
|
||||
private static final Logger LOGGER = Logger.getLogger(PluginManager.class.getName());
|
||||
|
||||
public static boolean FAST_LOOKUP = !Boolean.getBoolean(PluginManager.class.getName()+".noFastLookup");
|
||||
|
||||
|
||||
public static final Permission UPLOAD_PLUGINS = new Permission(Jenkins.PERMISSIONS, "UploadPlugins", Messages._PluginManager_UploadPluginsPermission_Description(),Jenkins.ADMINISTER,PermissionScope.JENKINS);
|
||||
|
||||
/**
|
||||
* Remembers why a plugin failed to deploy.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user