Skip to content

Commit

Permalink
[FIX JENKINS-20520] Save Jenkins after adding global user permission
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-beck committed Sep 14, 2017
1 parent b53384b commit 271cf2c
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -533,6 +533,11 @@ private String makeImg(String img, String tooltip, boolean inPlugin) {
@Override public boolean add(AuthorizationStrategy strategy, User user, Permission perm) {
if (strategy instanceof GlobalMatrixAuthorizationStrategy) {
((GlobalMatrixAuthorizationStrategy) strategy).add(perm, user.getId());
try {
Jenkins.getInstance().save();
} catch (IOException ioe) {
LOGGER.log(Level.WARNING, "Failed to save Jenkins after adding permission for user: " + user.getId(), ioe);
}
return true;
} else {
return false;
Expand Down

0 comments on commit 271cf2c

Please sign in to comment.