public static String jcrPrincipal(String cmisPrincipal) { return cmisPrincipal.equalsIgnoreCase(CMIS_ANYONE) ? SimplePrincipal.EVERYONE.getName() : cmisPrincipal; }
/** * Derives the correct principal type from the info encoded in the name of the provided * SimplePrincipal coming from ModeShape. If the SimplePrincipal does not have encoded * type info then just return it. * @param principal a SimplePrincipal that may have encoded type information. * @return the derived Principal */ private static Principal derivePrincipal(SimplePrincipal principal) { if (principal.getName().startsWith(USER_PREFIX)) { return new UsernamePrincipal(principal.getName().substring(USER_PREFIX.length())); } else if (principal.getName().startsWith(GROUP_PREFIX)) { return new GroupPrincipal(principal.getName().substring(GROUP_PREFIX.length())); } else { return principal; } }
for (AccessControlEntryImpl ace : principals.values()) { if (ace.getPrincipal().getName().equals(SimplePrincipal.EVERYONE.getName())) { if (ace.hasPrivileges(privileges)) { return true;
for (AccessControlEntryImpl ace : principals.values()) { if (ace.getPrincipal().getName().equals(SimplePrincipal.EVERYONE.getName())) { if (ace.hasPrivileges(privileges)) { return true;