getSecurityManager().getActiveRoleService().getRolesForUser(user.getUsername()));
} catch (IOException e) {
throw new WicketRuntimeException(e);
}
form.add(rolePalette = new RolePaletteFormComponent("roles", new ListModel(roles)));
rolePalette.add(new AjaxFormComponentUpdatingBehavior("onchange") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
updateCalculatedRoles(target);
updateGroupAdminList(target);
}
});
rolePalette.setOutputMarkupId(true);
rolePalette.setEnabled(hasRoleStore);
boolean isGroupAdmin = roles.contains(GeoServerRole.GROUP_ADMIN_ROLE);
List<GeoServerUserGroup> adminGroups = new ArrayList();
if (isGroupAdmin) {
for (String groupName : GroupAdminProperty.get(user.getProperties())) {
try {
adminGroups.add(ugService.getGroupByGroupname(groupName));
} catch (IOException e) {
throw new WicketRuntimeException(e);
}
}
}
form.add(adminGroupChoice = new UserGroupListMultipleChoice("adminGroups",
new ListModel(adminGroups), new GroupsModel(ugServiceName)));
adminGroupChoice.setOutputMarkupId(true);
adminGroupChoice.setEnabled(hasUserGroupStore && isGroupAdmin);
WebMarkupContainer container = new WebMarkupContainer("calculatedRolesContainer");
form.add(container);