Skip to content
Permalink
Browse files

Merge pull request #15 from pjanouse/JENKINS-32571-cleanup

[JENKINS-32571] Follow-up & clean-up
  • Loading branch information...
rsandell committed Mar 14, 2016
2 parents e27cb2e + 167cd62 commit cd049fc36de74e99287a9696b6ea9409ffff62c9
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/main/java/hudson/cli/CLICommandInvoker.java
@@ -120,8 +120,6 @@ public Result invokeWithArgs(final String... args) {

public Result invoke() {

Result result;
Error executionError = null;
setAuth();

final ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -131,11 +129,9 @@ public Result invoke() {
args, locale, stdin, new PrintStream(out), new PrintStream(err)
);

result = new Result(returnCode, out, err);

restoreAuth();

return result;
return new Result(returnCode, out, err);
}

private static class GrantPermissions extends AuthorizationStrategy {
@@ -169,6 +165,7 @@ protected Boolean hasPermission(Sid u, Permission permission) {
return Collections.emptySet();
}
}

private void setAuth() {

if (permissions.isEmpty()) return;

0 comments on commit cd049fc

Please sign in to comment.
You can’t perform that action at this time.