@Nonnull @Override public Iterator<Group> perform() throws RepositoryException { Iterator<Group> groups = delegate.memberOf(); return Iterators.transform(groups, new Function<Group, Group>() { @Nullable @Override public Group apply(@Nullable Group group) { return GroupDelegator.wrap(sessionDelegate, group); } }); } });
@NotNull @Override public Iterator<Group> perform() throws RepositoryException { Iterator<Group> groups = delegate.memberOf(); return Iterators.transform(groups, new Function<Group, Group>() { @Nullable @Override public Group apply(@Nullable Group group) { return GroupDelegator.wrap(sessionDelegate, group); } }); } });
@NotNull @Override public Iterator<Group> perform() throws RepositoryException { Iterator<Group> groups = delegate.memberOf(); return Iterators.transform(groups, new Function<Group, Group>() { @Nullable @Override public Group apply(@Nullable Group group) { return GroupDelegator.wrap(sessionDelegate, group); } }); } });
@Override public Iterator<Group> memberOf() throws RepositoryException { return AuthorizableWrapper.createGroupIterator(dlg.memberOf(), mgr); }
@Override public Iterator<Group> memberOf() throws RepositoryException { Iterator<Group> internal = delegate.memberOf(); return Iterators.transformIterator(internal, GroupFacade::new); }
@Override public Iterator<Group> memberOf() throws RepositoryException { return AuthorizableWrapper.createGroupIterator(dlg.memberOf(), mgr); }
public Iterator<Group> memberOf() throws RepositoryException { return user.memberOf(); }
@Override public Iterator<Group> memberOf() throws RepositoryException { return AuthorizableWrapper.createGroupIterator(dlg.memberOf(), mgr); }
while(paths.hasNext()) { Node node = paths.nextNode(); String usrPath = node.getPath(); Authorizable usr = usrMgr.getAuthorizableByPath(usrPath); String usrName = node.getProperty("rep:principalName").getString(); Iterator<Group> itrGrp = usr.memberOf(); String grpList = ""; if (itrGrp.hasNext()){ while(itrGrp.hasNext()) { Group grp = itrGrp.next(); String grpPath = grp.getPath(); grpList = grpList + grpPath + "</br>"; } } out.println("<tr><td>" + usrName + "</td><td>" +grpList + "</td></tr>"); }
private Set<Group> getGroupMembership(Authorizable authorizable) { Set<java.security.acl.Group> groupPrincipals = new HashSet<Group>(); try { Iterator<org.apache.jackrabbit.api.security.user.Group> groups = authorizable.memberOf(); while (groups.hasNext()) { Principal grPrincipal = groups.next().getPrincipal(); if (grPrincipal instanceof Group) { groupPrincipals.add((Group) grPrincipal); } } } catch (RepositoryException e) { log.debug(e.getMessage()); } groupPrincipals.add(EveryonePrincipal.getInstance()); return groupPrincipals; }
private Set<Principal> getGroupMembership(Authorizable authorizable) { Set<Principal> groupPrincipals = new HashSet<>(); try { Iterator<org.apache.jackrabbit.api.security.user.Group> groups = authorizable.memberOf(); while (groups.hasNext()) { Principal grPrincipal = groups.next().getPrincipal(); if (GroupPrincipals.isGroup(grPrincipal)) { groupPrincipals.add(grPrincipal); } } } catch (RepositoryException e) { log.debug(e.getMessage()); } groupPrincipals.add(EveryonePrincipal.getInstance()); return groupPrincipals; }
private Set<Principal> getGroupMembership(Authorizable authorizable) { Set<Principal> groupPrincipals = new HashSet<>(); try { Iterator<org.apache.jackrabbit.api.security.user.Group> groups = authorizable.memberOf(); while (groups.hasNext()) { Principal grPrincipal = groups.next().getPrincipal(); if (GroupPrincipals.isGroup(grPrincipal)) { groupPrincipals.add(grPrincipal); } } } catch (RepositoryException e) { log.debug(e.getMessage()); } groupPrincipals.add(EveryonePrincipal.getInstance()); return groupPrincipals; }
private Iterator<Group> getGroupParents(final ActionResult actionResult, final Authorizable authorizable) throws RepositoryException { String id = authorizable.getID(); actionResult.setAuthorizable(id); Iterator<Group> groups = authorizable.memberOf(); if (!groups.hasNext()) { actionResult.logWarning(MessagingUtils.groupIsMemberOfNoGroups(id)); } return groups; }
private Iterator<Group> getGroupParents(final ActionResult actionResult, final Authorizable authorizable) throws RepositoryException { String id = authorizable.getID(); actionResult.setAuthorizable(id); Iterator<Group> groups = authorizable.memberOf(); if (!groups.hasNext()) { actionResult.logWarning(MessagingUtils.groupIsMemberOfNoGroups(id)); } return groups; }
@Test public void testMemberOfIncludesEveryone() throws Exception { for (Authorizable a : authorizables) { Set<Group> groups = ImmutableSet.copyOf(a.memberOf()); assertTrue(groups.contains(everyoneGroup)); } }
public void testMemberOf() throws NotExecutableException, RepositoryException { Authorizable auth = getTestUser(superuser); Iterator<Group> it = auth.memberOf(); while (it.hasNext()) { Object group = it.next(); assertTrue(group instanceof Group); } }
@Test public void testGetMembersAgainstMemberOf() throws NotExecutableException, RepositoryException { Iterator<Authorizable> it = group.getMembers(); while (it.hasNext()) { Authorizable auth = it.next(); assertTrueMemberOfContainsGroup(auth.memberOf(), group); } }
public void testGetMembersAgainstMemberOf() throws NotExecutableException, RepositoryException { Group gr = getTestGroup(superuser); Iterator<Authorizable> it = gr.getMembers(); while (it.hasNext()) { Authorizable auth = it.next(); assertTrueMemberOfContainsGroup(auth.memberOf(), gr); } }
public void run() { try { while (running) { int idx = random.nextInt(NUM_USERS); Authorizable user = userMgr.getAuthorizable(TEST_USER_PREFIX + idx); long time = System.nanoTime(); user.memberOf(); stats.logTime(System.nanoTime() - time); } } catch (RepositoryException e) { exceptions.add(e); } finally { session.logout(); } } }
public CsvUser(Resource resource) throws RepositoryException { if (resource == null) { throw new IllegalArgumentException("Authorizable object cannot be null"); } final UserManager userManager = resource.adaptTo(UserManager.class); this.properties = resource.getValueMap(); this.authorizable = userManager.getAuthorizableByPath(resource.getPath()); this.declaredGroups = getGroupIds(authorizable.declaredMemberOf()); this.transitiveGroups = getGroupIds(authorizable.memberOf()); this.allGroups.addAll(this.transitiveGroups); this.transitiveGroups.removeAll(this.declaredGroups); this.firstName = properties.get("profile/givenName", ""); this.lastName = properties.get("profile/familyName", ""); this.email = properties.get("profile/email", ""); this.createdDate = properties.get(JcrConstants.JCR_CREATED, Calendar.class); this.lastModifiedDate = properties.get("cq:lastModified", Calendar.class); }