protected Group createGroup(String name, Set<Principal> principals) { Group roles = null; Iterator<Principal> iter = principals.iterator(); while (iter.hasNext()) { Object next = iter.next(); if (!(next instanceof Group)) continue; Group grp = (Group) next; if (grp.getName().equals(name)) { roles = grp; break; } } // If we did not find a group create one if (roles == null) { roles = new SimpleGroup(name); principals.add(roles); } return roles; }
protected Group createGroup(String name, Set<Principal> principals) { Group roles = null; Iterator<Principal> iter = principals.iterator(); while (iter.hasNext()) { Object next = iter.next(); if (!(next instanceof Group)) continue; Group grp = (Group) next; if (grp.getName().equals(name)) { roles = grp; break; } } // If we did not find a group create one if (roles == null) { roles = new SimpleGroup(name); principals.add(roles); } return roles; }
protected Group[] getRoleSets(Collection<String> roleSet) { SimpleGroup roles = new SimpleGroup("Roles"); Group[] roleSets = {roles}; for (String role : roleSet) { roles.addMember(new SimplePrincipal(role)); } return roleSets; }
protected Group[] getRoleSets(Collection<String> roleSet) { SimpleGroup roles = new SimpleGroup("Roles"); Group[] roleSets = {roles}; for (String role : roleSet) { roles.addMember(new SimplePrincipal(role)); } return roleSets; }