use of org.apache.jackrabbit.oak.spi.security.authorization.restriction.Restriction in project jackrabbit-oak by apache.
the class ACETest method testGetRestrictionsForMultiValued.
/**
* @since OAK 1.0: support for multi-value restrictions
*/
@Test
public void testGetRestrictionsForMultiValued() throws Exception {
// multivalued restriction
Restriction nameRestr = createRestriction(AccessControlConstants.REP_NT_NAMES, nameValues);
ACE ace = createEntry(nameRestr);
Value[] vs = ace.getRestrictions(AccessControlConstants.REP_NT_NAMES);
assertEquals(2, vs.length);
assertArrayEquals(nameValues, vs);
}
use of org.apache.jackrabbit.oak.spi.security.authorization.restriction.Restriction in project jackrabbit-oak by apache.
the class EntryTest method testGetRestrictionsForSingleValue.
/**
* @since OAK 1.0: support for multi-value restrictions
*/
@Test
public void testGetRestrictionsForSingleValue() throws Exception {
// single valued restriction
Restriction globRestr = createRestriction(AccessControlConstants.REP_GLOB, globValue);
ACE ace = createEntry(ImmutableSet.of(globRestr));
Value[] vs = ace.getRestrictions(AccessControlConstants.REP_GLOB);
assertNotNull(vs);
assertArrayEquals(new Value[] { globValue }, vs);
}
use of org.apache.jackrabbit.oak.spi.security.authorization.restriction.Restriction in project jackrabbit-oak by apache.
the class EntryTest method testGetNonExistingRestrictions.
/**
* @since OAK 1.0: support for multi-value restrictions
*/
@Test
public void testGetNonExistingRestrictions() throws Exception {
Restriction nameRestr = createRestriction(AccessControlConstants.REP_NT_NAMES, nameValues);
ACE ace = createEntry(ImmutableSet.of(nameRestr));
assertNull(ace.getRestrictions(AccessControlConstants.REP_GLOB));
}
use of org.apache.jackrabbit.oak.spi.security.authorization.restriction.Restriction in project jackrabbit-oak by apache.
the class EntryTest method testGetRestrictionsForMultiValued.
/**
* @since OAK 1.0: support for multi-value restrictions
*/
@Test
public void testGetRestrictionsForMultiValued() throws Exception {
// multivalued restriction
Restriction nameRestr = createRestriction(AccessControlConstants.REP_NT_NAMES, nameValues);
ACE ace = createEntry(ImmutableSet.of(nameRestr));
Value[] vs = ace.getRestrictions(AccessControlConstants.REP_NT_NAMES);
assertEquals(2, vs.length);
assertArrayEquals(nameValues, vs);
}
Aggregations