@Test public void testIsMember() throws Exception { Group g = createGroup(); Group g2 = createGroup(); g.addMember(g2); List<String> memberPaths = createMembers(g2, NUM_USERS/2); root.commit(); Tree groupTree = getTree(g); for (String path : memberPaths) { Tree tree = getTree(path); assertFalse(mp.isDeclaredMember(groupTree, tree)); assertTrue(mp.isMember(groupTree, tree)); } }
boolean isMember(@NotNull Tree groupTree, @NotNull Tree authorizableTree) { if (!hasMembers(groupTree)) { return false; } if (pendingChanges(groupTree)) { return Iterators.contains(getMembers(groupTree, true), authorizableTree.getPath()); } else { return hasMembership(authorizableTree, groupTree.getPath()); } }
MembershipProvider extends AuthorizableBaseProvider { boolean isMember(@NotNull Tree groupTree, @NotNull Tree authorizableTree) { if (!hasMembers(groupTree)) { return false; } if (pendingChanges(groupTree)) { return Iterators.contains(getMembers(groupTree, true), authorizableTree.getPath()); } else { return hasMembership(authorizableTree, groupTree.getPath()); } } }
MembershipProvider extends AuthorizableBaseProvider { boolean isMember(@NotNull Tree groupTree, @NotNull Tree authorizableTree) { if (!hasMembers(groupTree)) { return false; } if (pendingChanges(groupTree)) { return Iterators.contains(getMembers(groupTree, true), authorizableTree.getPath()); } else { return hasMembership(authorizableTree, groupTree.getPath()); } } MembershipProvider(@NotNull Root root, @NotNull ConfigurationParameters config); }
MembershipProvider extends AuthorizableBaseProvider { boolean isMember(@NotNull Tree groupTree, @NotNull Tree authorizableTree) { if (!hasMembers(groupTree)) { return false; } if (pendingChanges(groupTree)) { return Iterators.contains(getMembers(groupTree, true), authorizableTree.getPath()); } else { return hasMembership(authorizableTree, groupTree.getPath()); } } MembershipProvider(@NotNull Root root, @NotNull ConfigurationParameters config);  }
MembershipProvider extends AuthorizableBaseProvider { boolean isMember(@NotNull Tree groupTree, @NotNull Tree authorizableTree) { if (!hasMembers(groupTree)) { return false; } if (pendingChanges(groupTree)) { return Iterators.contains(getMembers(groupTree, true), authorizableTree.getPath()); } else { return hasMembership(authorizableTree, groupTree.getPath()); } } MembershipProvider(@NotNull Root root, @NotNull ConfigurationParameters config);   }