Skip to content

Commit

Permalink
[JENKINS-45942] - Attempt to solve issue (#49)
Browse files Browse the repository at this point in the history
* atempt to solve issue #45942

* atempt to solve issue #45942

* another way to same issue

* storing permission in a local variable to avoid duplicate call

* storing permission in a local variable to avoid duplicate call

* final commit

Did basic formatting suggested.

* Update RoleBasedAuthorizationStrategy.java
  • Loading branch information
deepanshnagaria authored and oleg-nenashev committed Dec 30, 2018
1 parent 30255ac commit a2069c1
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,12 @@ public void doAddRole(@QueryParameter(required = true) String type,

Set<Permission> permissionSet = new HashSet<>();
for (String p : permissionList) {
permissionSet.add(Permission.fromId(p));
Permission temp=Permission.fromId(p);
if (temp == null) {
throw new IOException("Cannot find permission for id=" + p + ", role name=" + roleName + " role type=" + type);
} else {
permissionSet.add(temp);
}
}
Role role = new Role(roleName, pttrn, permissionSet);
if (overwriteb) {
Expand Down

0 comments on commit a2069c1

Please sign in to comment.