Skip to content

Commit

Permalink
Fixed location of map-groups-to-roles attribute for AddSecurityRealm …
Browse files Browse the repository at this point in the history
…offline command
  • Loading branch information
Ondrej Lukas committed Feb 23, 2016
1 parent e72ea50 commit e939ae2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ public Builder plainText(Boolean plainText) {
@Override
public AddPropertiesAuthentication build() {
if (path == null) {
throw new IllegalArgumentException("Path of the security domain must be specified as non null value");
throw new IllegalArgumentException("Path of the property file must be specified as non null value");
}
if (path.isEmpty()) {
throw new IllegalArgumentException("Path of the security domain must not be empty value");
throw new IllegalArgumentException("Path of the property file must not be empty value");
}
return new AddPropertiesAuthentication(this);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
realmAttrs = ['name': atrSecurityRealmName]
if (atrMapGroupsToRoles != null) realmAttrs['map-groups-to-roles'] = atrMapGroupsToRoles

def realmDefinition = {
'security-realm'(realmAttrs)
'security-realm'(realmAttrs) {
if (atrMapGroupsToRoles != null) {
'authorization'(['map-groups-to-roles': atrMapGroupsToRoles])
}
}
}

def existingSecurityRealm = management.'security-realms'.'security-realm'.find { it.'@name' == atrSecurityRealmName }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public class AddSecurityRealmOfflineTest {
+ "<server xmlns=\"urn:jboss:domain:1.7\">\n"
+ " <management>\n"
+ " <security-realms>\n"
+ " <security-realm name=\"creaperSecRealm\" map-groups-to-roles=\"true\"/>\n"
+ " <security-realm name=\"creaperSecRealm\">\n"
+ " <authorization map-groups-to-roles=\"true\"/>"
+ " </security-realm>\n"
+ " </security-realms>\n"
+ " </management>\n"
+ "</server>";
Expand Down

0 comments on commit e939ae2

Please sign in to comment.