Skip to content
Permalink
Browse files

[JENKINS-32571] Follow-up & clean-up

  • Loading branch information...
pjanouse committed Mar 10, 2016
1 parent e1d9256 commit 167cd62c915d9d5eff67870208c5e6f7efb0f3a2
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 167cd62

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