Lines 736-742
class MemoryGroupCreationFactory extends AbstractObjectCreationFactory {
Link Here
|
736 |
} |
736 |
} |
737 |
String description = attributes.getValue("description"); |
737 |
String description = attributes.getValue("description"); |
738 |
String roles = attributes.getValue("roles"); |
738 |
String roles = attributes.getValue("roles"); |
739 |
Group group = database.createGroup(groupname, description); |
739 |
Group group = database.findGroup(groupname); |
|
|
740 |
if (group == null) { |
741 |
group = database.createGroup(groupname, description); |
742 |
} else { |
743 |
if (group.getDescription() == null) { |
744 |
group.setDescription(description); |
745 |
} |
746 |
} |
740 |
if (roles != null) { |
747 |
if (roles != null) { |
741 |
while (roles.length() > 0) { |
748 |
while (roles.length() > 0) { |
742 |
String rolename = null; |
749 |
String rolename = null; |
Lines 781-788
class MemoryRoleCreationFactory extends AbstractObjectCreationFactory {
Link Here
|
781 |
rolename = attributes.getValue("name"); |
788 |
rolename = attributes.getValue("name"); |
782 |
} |
789 |
} |
783 |
String description = attributes.getValue("description"); |
790 |
String description = attributes.getValue("description"); |
784 |
Role role = database.createRole(rolename, description); |
791 |
Role existingRole = database.findRole(rolename); |
785 |
return role; |
792 |
if (existingRole == null) { |
|
|
793 |
return database.createRole(rolename, description); |
794 |
} |
795 |
if (existingRole.getDescription() == null) { |
796 |
existingRole.setDescription(description); |
797 |
} |
798 |
return existingRole; |
786 |
} |
799 |
} |
787 |
|
800 |
|
788 |
private final MemoryUserDatabase database; |
801 |
private final MemoryUserDatabase database; |
789 |
- |
|
|