Skip to content
Permalink
Browse files
[DONE JENKINS-48173] added new permission
  • Loading branch information
escoem committed May 29, 2018
1 parent b3c9258 commit 799cb60addc00f9b9a41d323845d92447e4c2261
@@ -36,6 +36,9 @@
import hudson.model.RootAction;
import hudson.model.TopLevelItem;
import hudson.security.ACL;
import hudson.security.Permission;
import hudson.security.PermissionGroup;
import hudson.security.PermissionScope;
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
import jenkins.model.Jenkins;
@@ -78,6 +81,13 @@
@Extension
public final class JobImportAction implements RootAction, Describable<JobImportAction> {

public static final PermissionGroup JOB_IMPORT_PERMISSIONS =
new PermissionGroup(JobImportAction.class, Messages._Job_Import_Plugin_PermissionGroup());

public static final Permission JOB_IMPORT =
new Permission(JOB_IMPORT_PERMISSIONS, "JobImport", Messages._Job_Import_Plugin_Permission(),
Jenkins.ADMINISTER, PermissionScope.JENKINS);

private static final Logger LOG = Logger.getLogger(JobImportAction.class.getName());

public void doClear(final StaplerRequest request, final StaplerResponse response)
@@ -26,9 +26,7 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<j:set var="instance" value="${it}"/>
<j:set var="descriptor" value="${instance.descriptor}"/>
<j:getStatic var="permission" className="hudson.model.Item" field="CREATE"/>
<l:layout permission="${permission}" title="${%Job.Import.Plugin.Title}">
<!-- <st:include page="/hudson/model/View/sidepanel.jelly" /> -->
<l:layout permission="${it.JOB_IMPORT}" title="${%Job.Import.Plugin.Title}">
<l:main-panel>
<style>
table.jobImportPlugin { /* width: 100%; */ }
@@ -22,9 +22,12 @@
# THE SOFTWARE.
#

DisplayName = Job Import Plugin
DisplayName = Job Import Plugin

Job.Import.Plugin.Import.Success = SUCCESS
Job.Import.Plugin.Import.Success.NotReloaded = SUCCESS - Reload was not performed due to lack of Overall/Administer permissions.
Job.Import.Plugin.Import.Failed.Duplicate = FAILED - Duplicate Job Name
Job.Import.Plugin.Import.Failed.Exception = FAILED - {0}

Job.Import.Plugin.PermissionGroup = Job Import
Job.Import.Plugin.Permission = Import Jobs

0 comments on commit 799cb60

Please sign in to comment.