AbstractAccessControlList implements JackrabbitAccessControlList { @Override public boolean isMultiValueRestriction(@NotNull String restrictionName) { for (RestrictionDefinition definition : getRestrictionProvider().getSupportedRestrictions(getOakPath())) { String jcrName = namePathMapper.getJcrName(definition.getName()); if (jcrName.equals(restrictionName)) { return definition.getRequiredType().isArray(); } } return false; } AbstractAccessControlList(@Nullable String oakPath,
                                     @NotNull NamePathMapper namePathMapper); @Nullable String getOakPath(); @NotNull NamePathMapper getNamePathMapper(); @NotNull abstract List<? extends JackrabbitAccessControlEntry> getEntries(); @NotNull abstract RestrictionProvider getRestrictionProvider(); @Nullable @Override String getPath(); @Override AccessControlEntry[] getAccessControlEntries(); @Override boolean addAccessControlEntry(Principal principal, Privilege[] privileges); @Override boolean isEmpty(); @Override int size(); @NotNull @Override String[] getRestrictionNames(); @Override int getRestrictionType(@NotNull String restrictionName); @Override boolean isMultiValueRestriction(@NotNull String restrictionName); @Override boolean addEntry(@NotNull Principal principal, @NotNull Privilege[] privileges, boolean isAllow); @Override boolean addEntry(@NotNull Principal principal, @NotNull Privilege[] privileges, boolean isAllow, @Nullable Map<String, Value> restrictions);  }
@Test public void testIsMultiValueRestriction() { AbstractAccessControlList acl = createEmptyACL(); for (RestrictionDefinition def : getRestrictionProvider().getSupportedRestrictions(getTestPath())) { boolean isMv = acl.isMultiValueRestriction(getNamePathMapper().getJcrName(def.getName())); assertEquals(def.getRequiredType().isArray(), isMv); } }
@Test public void testIsMultiValueRestrictionForUnknownName() { assertFalse(createEmptyACL().isMultiValueRestriction("unknownRestrictionName")); }