/** * @param principal the principal * @param provider the provider * @return A group that only reveals those members that are visible to the * current session or the specified principal if its not a group or the * everyone principal. */ private Principal disguise(Principal principal, PrincipalProvider provider) { if (!GroupPrincipals.isGroup(principal) || principal instanceof EveryonePrincipal) { // nothing to do. return principal; } // make sure all groups except for the 'everyone' group expose only // principals visible to the session. if (principal instanceof ItemBasedPrincipal) { return new ItemBasedCheckedGroup(principal, provider); } else { return new CheckedGroup(principal, provider); } }
/** * @param principal the principal * @param provider the provider * @return A group that only reveals those members that are visible to the * current session or the specified principal if its not a group or the * everyone principal. */ private Principal disguise(Principal principal, PrincipalProvider provider) { if (!GroupPrincipals.isGroup(principal) || principal instanceof EveryonePrincipal) { // nothing to do. return principal; } // make sure all groups except for the 'everyone' group expose only // principals visible to the session. if (principal instanceof ItemBasedPrincipal) { return new ItemBasedCheckedGroup(principal, provider); } else { return new CheckedGroup(principal, provider); } }