@Test public void testTreeBasedGroupPrincipalReflectsChangedType() throws Exception { Principal principal = principalProvider.getPrincipal(testGroup.getPrincipal().getName()); assertTrue(principal instanceof AbstractGroupPrincipal); AbstractGroupPrincipal agp = (AbstractGroupPrincipal) principal; Tree t = root.getTree(testGroup.getPath()); t.setProperty(JCR_PRIMARYTYPE, NT_REP_USER, Type.NAME); assertFalse(agp.isMember(getTestUser())); }
@Override public Principal getPrincipal(@NotNull String principalName) { Tree authorizableTree = userProvider.getAuthorizableByPrincipal(new PrincipalImpl(principalName)); Principal principal = createPrincipal(authorizableTree); if (principal == null) { return (EveryonePrincipal.NAME.equals(principalName)) ? EveryonePrincipal.getInstance() : null; } else { return principal; } }
UserPrincipalProvider implements PrincipalProvider { @Override public Principal getPrincipal(@NotNull String principalName) { Tree authorizableTree = userProvider.getAuthorizableByPrincipal(new PrincipalImpl(principalName)); Principal principal = createPrincipal(authorizableTree); if (principal == null) { return (EveryonePrincipal.NAME.equals(principalName)) ? EveryonePrincipal.getInstance() : null; } else { return principal; } } }
UserPrincipalProvider implements PrincipalProvider { @Override public Principal getPrincipal(@NotNull String principalName) { Tree authorizableTree = userProvider.getAuthorizableByPrincipal(new PrincipalImpl(principalName)); Principal principal = createPrincipal(authorizableTree); if (principal == null) { return (EveryonePrincipal.NAME.equals(principalName)) ? EveryonePrincipal.getInstance() : null; } else { return principal; } } UserPrincipalProvider(@NotNull Root root,
                          @NotNull UserConfiguration userConfiguration,
                          @NotNull NamePathMapper namePathMapper); }
UserPrincipalProvider implements PrincipalProvider { @Override public Principal getPrincipal(@NotNull String principalName) { Tree authorizableTree = userProvider.getAuthorizableByPrincipal(new PrincipalImpl(principalName)); Principal principal = createPrincipal(authorizableTree); if (principal == null) { return (EveryonePrincipal.NAME.equals(principalName)) ? EveryonePrincipal.getInstance() : null; } else { return principal; } } UserPrincipalProvider(@NotNull Root root,
                          @NotNull UserConfiguration userConfiguration,
                          @NotNull NamePathMapper namePathMapper); @Override Principal getPrincipal(@NotNull String principalName); @Nullable @Override ItemBasedPrincipal getItemBasedPrincipal(@NotNull String principalOakPath); @NotNull @Override Set<Principal> getMembershipPrincipals(@NotNull Principal principal); @NotNull @Override Set<? extends Principal> getPrincipals(@NotNull String userID); @NotNull @Override Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final int searchType); @NotNull @Override Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final boolean fullText, final int searchType, long offset,
            long limit); @NotNull @Override Iterator<? extends Principal> findPrincipals(int searchType); }
UserPrincipalProvider implements PrincipalProvider { @Override public Principal getPrincipal(@NotNull String principalName) { Tree authorizableTree = userProvider.getAuthorizableByPrincipal(new PrincipalImpl(principalName)); Principal principal = createPrincipal(authorizableTree); if (principal == null) { return (EveryonePrincipal.NAME.equals(principalName)) ? EveryonePrincipal.getInstance() : null; } else { return principal; } } UserPrincipalProvider(@NotNull Root root,
                          @NotNull UserConfiguration userConfiguration,
                          @NotNull NamePathMapper namePathMapper); @Override Principal getPrincipal(@NotNull String principalName); @Nullable @Override ItemBasedPrincipal getItemBasedPrincipal(@NotNull String principalOakPath); @NotNull @Override Set<Principal> getMembershipPrincipals(@NotNull Principal principal); @NotNull @Override Set<? extends Principal> getPrincipals(@NotNull String userID); @NotNull @Override Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final int searchType); @NotNull @Override Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final boolean fullText, final int searchType, long offset,
            long limit); @NotNull @Override Iterator<? extends Principal> findPrincipals(int searchType);  }