use of org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinitionImpl in project jackrabbit-oak by apache.
the class AbstractRestrictionProviderTest method before.
@Before
@Override
public void before() throws Exception {
super.before();
valueFactory = new ValueFactoryImpl(root, namePathMapper);
globValue = valueFactory.createValue("*");
nameValue = valueFactory.createValue("nt:file", PropertyType.NAME);
nameValues = new Value[] { valueFactory.createValue("nt:folder", PropertyType.NAME), valueFactory.createValue("nt:file", PropertyType.NAME) };
RestrictionDefinition glob = new RestrictionDefinitionImpl(REP_GLOB, Type.STRING, false);
RestrictionDefinition nts = new RestrictionDefinitionImpl(REP_NT_NAMES, Type.NAMES, false);
RestrictionDefinition mand = new RestrictionDefinitionImpl("mandatory", Type.BOOLEAN, true);
supported = ImmutableMap.of(glob.getName(), glob, nts.getName(), nts, mand.getName(), mand);
restrictionProvider = new TestProvider(supported);
}
use of org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinitionImpl in project jackrabbit-oak by apache.
the class PrincipalRestrictionProvider method getSupportedRestrictions.
@Nonnull
@Override
public Set<RestrictionDefinition> getSupportedRestrictions(@Nullable String oakPath) {
Set<RestrictionDefinition> definitions = new HashSet<RestrictionDefinition>(base.getSupportedRestrictions(oakPath));
definitions.add(new RestrictionDefinitionImpl(REP_NODE_PATH, Type.PATH, true));
return definitions;
}
use of org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinitionImpl in project jackrabbit-oak by apache.
the class AbstractAccessControlListTest method getRestrictionProvider.
protected RestrictionProvider getRestrictionProvider() {
Map<String, RestrictionDefinition> rDefs = new HashMap();
rDefs.put("r1", new RestrictionDefinitionImpl("r1", Type.STRING, true));
rDefs.put("r2", new RestrictionDefinitionImpl("r2", Type.LONGS, false));
return new AbstractRestrictionProvider(rDefs) {
@Nonnull
@Override
public RestrictionPattern getPattern(@Nullable String oakPath, @Nonnull Tree tree) {
throw new UnsupportedOperationException();
}
@Nonnull
@Override
public RestrictionPattern getPattern(@Nullable String oakPath, @Nonnull Set<Restriction> restrictions) {
throw new UnsupportedOperationException();
}
};
}
use of org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinitionImpl in project sling by apache.
the class SlingRestrictionProviderImpl method supportedRestrictions.
private static Map<String, RestrictionDefinition> supportedRestrictions() {
RestrictionDefinition slingResourceTypes = new RestrictionDefinitionImpl(SLING_RESOURCE_TYPES, Type.STRINGS, false);
RestrictionDefinition slingResourceTypesWithChildren = new RestrictionDefinitionImpl(SLING_RESOURCE_TYPES_WITH_DESCENDANTS, Type.STRINGS, false);
Map<String, RestrictionDefinition> supportedRestrictions = new HashMap<String, RestrictionDefinition>();
supportedRestrictions.put(slingResourceTypes.getName(), slingResourceTypes);
supportedRestrictions.put(slingResourceTypesWithChildren.getName(), slingResourceTypesWithChildren);
return Collections.unmodifiableMap(supportedRestrictions);
}
use of org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinitionImpl in project jackrabbit-oak by apache.
the class RestrictionProviderImpl method supportedRestrictions.
private static Map<String, RestrictionDefinition> supportedRestrictions() {
RestrictionDefinition glob = new RestrictionDefinitionImpl(REP_GLOB, Type.STRING, false);
RestrictionDefinition nts = new RestrictionDefinitionImpl(REP_NT_NAMES, Type.NAMES, false);
RestrictionDefinition pfxs = new RestrictionDefinitionImpl(REP_PREFIXES, Type.STRINGS, false);
RestrictionDefinition names = new RestrictionDefinitionImpl(REP_ITEM_NAMES, Type.NAMES, false);
return ImmutableMap.of(glob.getName(), glob, nts.getName(), nts, pfxs.getName(), pfxs, names.getName(), names);
}
Aggregations