public UserGroupPaletteFormComponent(String id, IModel<List<GeoServerUserGroup>> model, final String ugServiceName, GeoServerUser user) { super(id, model, (IModel) new GroupsModel(ugServiceName), new ChoiceRenderer<GeoServerUserGroup>("groupname", "groupname")); add(new SubmitLink("addGroup") { @Override public void onSubmit() { setResponsePage(new NewGroupPage(ugServiceName).setReturnPage(this.getPage())); } }); }
public void diff(Collection<GeoServerUserGroup> orig, Collection<GeoServerUserGroup> add, Collection<GeoServerUserGroup> remove) { remove.addAll(orig); for (GeoServerUserGroup group : getSelectedGroups()) { if (!orig.contains(group)) { add.add(group); } else { remove.remove(group); } } }
form.add(userGroupPalette = new UserGroupPaletteFormComponent("groups", ugServiceName, user)); userGroupPalette.add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { userGroupPalette.setEnabled(hasUserGroupStore);
Set<GeoServerUserGroup> add = new HashSet<GeoServerUserGroup>(); Set<GeoServerUserGroup> remove = new HashSet<GeoServerUserGroup>(); userGroupPalette.diff(orig, add, remove);
form.add(userGroupPalette = new UserGroupPaletteFormComponent("groups", ugServiceName, user)); userGroupPalette.add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { userGroupPalette.setEnabled(hasUserGroupStore);
Set<GeoServerUserGroup> add = new HashSet<GeoServerUserGroup>(); Set<GeoServerUserGroup> remove = new HashSet<GeoServerUserGroup>(); userGroupPalette.diff(orig, add, remove);
new UserGroupPaletteFormComponent("groups", ugServiceName, user)); userGroupPalette.add( new AjaxFormComponentUpdatingBehavior("change") { @Override userGroupPalette.setEnabled(hasUserGroupStore);
public void diff( Collection<GeoServerUserGroup> orig, Collection<GeoServerUserGroup> add, Collection<GeoServerUserGroup> remove) { remove.addAll(orig); for (GeoServerUserGroup group : getSelectedGroups()) { if (!orig.contains(group)) { add.add(group); } else { remove.remove(group); } } }
public UserGroupPaletteFormComponent(String id, IModel<List<GeoServerUserGroup>> model, final String ugServiceName, GeoServerUser user) { super(id, model, (IModel) new GroupsModel(ugServiceName), new ChoiceRenderer<GeoServerUserGroup>("groupname", "groupname")); add(new SubmitLink("addGroup") { @Override public void onSubmit() { setResponsePage(new NewGroupPage(ugServiceName).setReturnPage(this.getPage())); } }); }
Set<GeoServerUserGroup> add = new HashSet<GeoServerUserGroup>(); Set<GeoServerUserGroup> remove = new HashSet<GeoServerUserGroup>(); userGroupPalette.diff(orig, add, remove);
public void diff(Collection<GeoServerUserGroup> orig, Collection<GeoServerUserGroup> add, Collection<GeoServerUserGroup> remove) { remove.addAll(orig); for (GeoServerUserGroup group : getSelectedGroups()) { if (!orig.contains(group)) { add.add(group); } else { remove.remove(group); } } }
public UserGroupPaletteFormComponent( String id, IModel<List<GeoServerUserGroup>> model, final String ugServiceName, GeoServerUser user) { super( id, model, (IModel) new GroupsModel(ugServiceName), new ChoiceRenderer<GeoServerUserGroup>("groupname", "groupname")); add( new SubmitLink("addGroup") { @Override public void onSubmit() { setResponsePage( new NewGroupPage(ugServiceName).setReturnPage(this.getPage())); } }); }
@Override protected List<GeoServerRole> load() { List<GeoServerRole> tmp = new ArrayList<GeoServerRole>(); List<GeoServerRole> result = new ArrayList<GeoServerRole>(); try { GeoServerUserGroupService ugService = getSecurityManager() .loadUserGroupService(ugServiceName); GeoServerRoleService gaService = getSecurityManager() .getActiveRoleService(); RoleCalculator calc = new RoleCalculator(ugService, gaService); tmp.addAll(rolePalette.getSelectedRoles()); calc.addInheritedRoles(tmp); for (GeoServerUserGroup group : userGroupPalette.getSelectedGroups()) { if (group.isEnabled()) { tmp.addAll(calc.calculateRoles(group)); } } result.addAll(calc.personalizeRoles(user, tmp)); } catch (IOException e) { throw new RuntimeException(e); } Collections.sort(result); return result; } }
@Override protected List<GeoServerRole> load() { List<GeoServerRole> tmp = new ArrayList<GeoServerRole>(); List<GeoServerRole> result = new ArrayList<GeoServerRole>(); try { GeoServerUserGroupService ugService = getSecurityManager() .loadUserGroupService(ugServiceName); GeoServerRoleService gaService = getSecurityManager() .getActiveRoleService(); RoleCalculator calc = new RoleCalculator(ugService, gaService); tmp.addAll(rolePalette.getSelectedRoles()); calc.addInheritedRoles(tmp); for (GeoServerUserGroup group : userGroupPalette.getSelectedGroups()) { if (group.isEnabled()) { tmp.addAll(calc.calculateRoles(group)); } } result.addAll(calc.personalizeRoles(user, tmp)); } catch (IOException e) { throw new RuntimeException(e); } Collections.sort(result); return result; } }
@Override protected List<GeoServerRole> load() { List<GeoServerRole> tmp = new ArrayList<GeoServerRole>(); List<GeoServerRole> result = new ArrayList<GeoServerRole>(); try { GeoServerUserGroupService ugService = getSecurityManager().loadUserGroupService(ugServiceName); GeoServerRoleService gaService = getSecurityManager().getActiveRoleService(); RoleCalculator calc = new RoleCalculator(ugService, gaService); tmp.addAll(rolePalette.getSelectedRoles()); calc.addInheritedRoles(tmp); for (GeoServerUserGroup group : userGroupPalette.getSelectedGroups()) { if (group.isEnabled()) { tmp.addAll(calc.calculateRoles(group)); } } result.addAll(calc.personalizeRoles(user, tmp)); } catch (IOException e) { throw new RuntimeException(e); } Collections.sort(result); return result; } }
ugStore.addUser(user); for (GeoServerUserGroup group : userGroupPalette.getSelectedGroups()) { ugStore.associateUserToGroup(user, group);
ugStore.addUser(user); for (GeoServerUserGroup group : userGroupPalette.getSelectedGroups()) { ugStore.associateUserToGroup(user, group);
ugStore.addUser(user); for (GeoServerUserGroup group : userGroupPalette.getSelectedGroups()) { ugStore.associateUserToGroup(user, group);