@Test public void testRemoveUnmanagedPrincipalNamesAtPath() { Set<String> principalSet = principalSet(beanTestGroupAllManaged.getPrincipalName(), testgroupPartlyManaged.getPrincipalName(), beanEveryone.getPrincipalName()); Set<String> onlyManagedPrincipalNames = authorizablesConfig.removeUnmanagedPrincipalNamesAtPath("/etc/linkchecker", principalSet, null); assertEquals(principalSet("testgroupAllManaged", "testgroupPartlyManaged", "everyone"), onlyManagedPrincipalNames); onlyManagedPrincipalNames = authorizablesConfig.removeUnmanagedPrincipalNamesAtPath("/etc", principalSet, null); assertEquals(principalSet("testgroupAllManaged", "testgroupPartlyManaged"), onlyManagedPrincipalNames); onlyManagedPrincipalNames = authorizablesConfig.removeUnmanagedPrincipalNamesAtPath("/content/geometrixx", principalSet, null); assertEquals(principalSet("testgroupAllManaged", "testgroupPartlyManaged"), onlyManagedPrincipalNames); onlyManagedPrincipalNames = authorizablesConfig.removeUnmanagedPrincipalNamesAtPath("/content/dam/geometrixx", principalSet, null); assertEquals(principalSet("testgroupAllManaged"), onlyManagedPrincipalNames); }
public Set<String> removeUnmanagedPrincipalNamesAtPath(String path, Set<String> principals, String defaultUnmanagedAcePathsRegex) { Set<String> filteredPrincipals = new HashSet<String>(); for (String principal : principals) { AuthorizableConfigBean authorizableConfig = getAuthorizableConfigByPrincipalName(principal); if (authorizableConfig == null || authorizableConfig.managesPath(path, defaultUnmanagedAcePathsRegex)) { filteredPrincipals.add(principal); } } return filteredPrincipals; }
AuthorizablesConfig extends LinkedHashSet<AuthorizableConfigBean> { public Set<String> removeUnmanagedPrincipalNamesAtPath(String path, Set<String> principals, String defaultUnmanagedAcePathsRegex) { Set<String> filteredPrincipals = new HashSet<String>(); for (String principal : principals) { AuthorizableConfigBean authorizableConfig = getAuthorizableConfigByPrincipalName(principal); if (authorizableConfig == null || authorizableConfig.managesPath(path, defaultUnmanagedAcePathsRegex)) { filteredPrincipals.add(principal); } } return filteredPrincipals; } }
AuthorizablesConfig extends LinkedHashSet<AuthorizableConfigBean> { public Set<String> removeUnmanagedPrincipalNamesAtPath(String path, Set<String> principals, String defaultUnmanagedAcePathsRegex) { Set<String> filteredPrincipals = new HashSet<String>(); for (String principal : principals) { AuthorizableConfigBean authorizableConfig = getAuthorizableConfigByPrincipalName(principal); if (authorizableConfig == null || authorizableConfig.managesPath(path, defaultUnmanagedAcePathsRegex)) { filteredPrincipals.add(principal); } } return filteredPrincipals; }  }
AuthorizablesConfig extends LinkedHashSet<AuthorizableConfigBean> { public Set<String> removeUnmanagedPrincipalNamesAtPath(String path, Set<String> principals, String defaultUnmanagedAcePathsRegex) { Set<String> filteredPrincipals = new HashSet<String>(); for (String principal : principals) { AuthorizableConfigBean authorizableConfig = getAuthorizableConfigByPrincipalName(principal); if (authorizableConfig == null || authorizableConfig.managesPath(path, defaultUnmanagedAcePathsRegex)) { filteredPrincipals.add(principal); } } return filteredPrincipals; }  AuthorizableConfigBean getAuthorizableConfig(String authorizableId); AuthorizableConfigBean getAuthorizableConfigByPrincipalName(String principalName); Set<String> getAuthorizableIds(); Set<String> getPrincipalNames(); String getPrincipalNameForAuthorizableId(String authorizableId); Set<String> removeUnmanagedPrincipalNamesAtPath(String path, Set<String> principals, String defaultUnmanagedAcePathsRegex); }
AuthorizablesConfig extends LinkedHashSet<AuthorizableConfigBean> { public Set<String> removeUnmanagedPrincipalNamesAtPath(String path, Set<String> principals, String defaultUnmanagedAcePathsRegex) { Set<String> filteredPrincipals = new HashSet<String>(); for (String principal : principals) { AuthorizableConfigBean authorizableConfig = getAuthorizableConfigByPrincipalName(principal); if (authorizableConfig == null || authorizableConfig.managesPath(path, defaultUnmanagedAcePathsRegex)) { filteredPrincipals.add(principal); } } return filteredPrincipals; }  AuthorizableConfigBean getAuthorizableConfig(String authorizableId); AuthorizableConfigBean getAuthorizableConfigByPrincipalName(String principalName); Set<String> getAuthorizableIds(); Set<String> getPrincipalNames(); String getPrincipalNameForAuthorizableId(String authorizableId); Set<String> removeUnmanagedPrincipalNamesAtPath(String path, Set<String> principals, String defaultUnmanagedAcePathsRegex);  }