Skip to content

Commit

Permalink
impersonate as SYSTEM to apply configuration
Browse files Browse the repository at this point in the history
close #535

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Sep 25, 2018
1 parent 6db18b4 commit f6b7ac3
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -7,6 +7,8 @@
import hudson.init.Initializer;
import hudson.model.ManagementLink;
import hudson.remoting.Which;
import hudson.security.ACL;
import hudson.security.ACLContext;
import hudson.util.FormValidation;
import io.jenkins.plugins.casc.impl.DefaultConfiguratorRegistry;
import io.jenkins.plugins.casc.model.CNode;
Expand Down Expand Up @@ -631,7 +633,9 @@ private void configureWith(Mapping entries) throws ConfiguratorException {
monitor.reset();
ConfigurationContext context = new ConfigurationContext(registry);
context.addListener(monitor::record);
invokeWith(entries, (configurator, config) -> configurator.configure(config, context));
try (ACLContext acl = ACL.as(ACL.SYSTEM)) {
invokeWith(entries, (configurator, config) -> configurator.configure(config, context));
}
}

public Map<Source, String> checkWith(Mapping entries) throws ConfiguratorException {
Expand Down

0 comments on commit f6b7ac3

Please sign in to comment.