Search in sources :

Example 1 with CugConfiguration

use of org.apache.jackrabbit.oak.spi.security.authorization.cug.impl.CugConfiguration in project jackrabbit-filevault by apache.

the class CugHandlingTest method createSecirityProvider.

private static SecurityProvider createSecirityProvider() {
    ConfigurationParameters params = ConfigurationParameters.of("cugSupportedPaths", TEST_ROOT, "cugEnabled", true);
    CugConfiguration cugConfiguration = new CugConfiguration();
    cugConfiguration.setParameters(params);
    SecurityProvider result = SecurityProviderBuilder.newBuilder().with(ConfigurationParameters.of(params)).build();
    SecurityProviderHelper.updateConfig(result, cugConfiguration, AuthorizationConfiguration.class);
    return result;
}
Also used : CugConfiguration(org.apache.jackrabbit.oak.spi.security.authorization.cug.impl.CugConfiguration) SecurityProvider(org.apache.jackrabbit.oak.spi.security.SecurityProvider) ConfigurationParameters(org.apache.jackrabbit.oak.spi.security.ConfigurationParameters)

Example 2 with CugConfiguration

use of org.apache.jackrabbit.oak.spi.security.authorization.cug.impl.CugConfiguration in project jackrabbit-oak by apache.

the class L3_UnderstandAggregationTest method initSecurityProvider.

@Override
protected SecurityProvider initSecurityProvider() {
    SecurityProvider sp = super.initSecurityProvider();
    CugConfiguration cugConfiguration = new CugConfiguration();
    cugConfiguration.setParameters(ConfigurationParameters.of("cugSupportedPaths", new String[] { "/content" }, "cugEnabled", true));
    SecurityProviderHelper.updateConfig(sp, cugConfiguration, AuthorizationConfiguration.class);
    return sp;
}
Also used : CugConfiguration(org.apache.jackrabbit.oak.spi.security.authorization.cug.impl.CugConfiguration) SecurityProvider(org.apache.jackrabbit.oak.spi.security.SecurityProvider)

Example 3 with CugConfiguration

use of org.apache.jackrabbit.oak.spi.security.authorization.cug.impl.CugConfiguration in project jackrabbit-oak by apache.

the class CugTest method newTestSecurityProvider.

private static SecurityProvider newTestSecurityProvider(@NotNull ConfigurationParameters params, boolean reverseOrder) {
    SecurityProvider delegate = SecurityProviderBuilder.newBuilder().with(params).build();
    CompositeAuthorizationConfiguration authorizationConfiguration = (CompositeAuthorizationConfiguration) delegate.getConfiguration((AuthorizationConfiguration.class));
    AuthorizationConfiguration defaultAuthorization = checkNotNull(authorizationConfiguration.getDefaultConfig());
    if (reverseOrder) {
        authorizationConfiguration.addConfiguration(defaultAuthorization);
        authorizationConfiguration.addConfiguration(new CugConfiguration(delegate));
    } else {
        authorizationConfiguration.addConfiguration(new CugConfiguration(delegate));
        authorizationConfiguration.addConfiguration(defaultAuthorization);
    }
    return delegate;
}
Also used : CugConfiguration(org.apache.jackrabbit.oak.spi.security.authorization.cug.impl.CugConfiguration) CompositeAuthorizationConfiguration(org.apache.jackrabbit.oak.security.authorization.composite.CompositeAuthorizationConfiguration) AuthorizationConfiguration(org.apache.jackrabbit.oak.spi.security.authorization.AuthorizationConfiguration) SecurityProvider(org.apache.jackrabbit.oak.spi.security.SecurityProvider) CompositeAuthorizationConfiguration(org.apache.jackrabbit.oak.security.authorization.composite.CompositeAuthorizationConfiguration)

Aggregations

SecurityProvider (org.apache.jackrabbit.oak.spi.security.SecurityProvider)3 CugConfiguration (org.apache.jackrabbit.oak.spi.security.authorization.cug.impl.CugConfiguration)3 CompositeAuthorizationConfiguration (org.apache.jackrabbit.oak.security.authorization.composite.CompositeAuthorizationConfiguration)1 ConfigurationParameters (org.apache.jackrabbit.oak.spi.security.ConfigurationParameters)1 AuthorizationConfiguration (org.apache.jackrabbit.oak.spi.security.authorization.AuthorizationConfiguration)1