Search in sources :

Example 1 with RestrictionProviderImpl

use of org.apache.jackrabbit.oak.security.authorization.restriction.RestrictionProviderImpl in project jackrabbit-oak by apache.

the class SecurityProviderBuilder method with.

public SecurityProviderBuilder with(@Nonnull ConfigurationParameters configuration) {
    authenticationParams = configuration.getConfigValue(AuthenticationConfiguration.NAME, EMPTY);
    privilegeParams = configuration.getConfigValue(PrivilegeConfiguration.NAME, EMPTY);
    if (configuration.contains(UserConfiguration.NAME)) {
        userParams = configuration.getConfigValue(UserConfiguration.NAME, EMPTY);
    } else {
        AuthorizableActionProvider authorizableActionProvider = new DefaultAuthorizableActionProvider();
        AuthorizableNodeName authorizableNodeName = AuthorizableNodeName.DEFAULT;
        UserAuthenticationFactory userAuthenticationFactory = UserConfigurationImpl.getDefaultAuthenticationFactory();
        userParams = ConfigurationParameters.of(ConfigurationParameters.of(UserConstants.PARAM_AUTHORIZABLE_ACTION_PROVIDER, authorizableActionProvider), ConfigurationParameters.of(UserConstants.PARAM_AUTHORIZABLE_NODE_NAME, authorizableNodeName), ConfigurationParameters.of(UserConstants.PARAM_USER_AUTHENTICATION_FACTORY, userAuthenticationFactory));
    }
    if (configuration.contains(AuthorizationConfiguration.NAME)) {
        authorizationParams = configuration.getConfigValue(AuthorizationConfiguration.NAME, EMPTY);
    } else {
        RestrictionProvider restrictionProvider = new RestrictionProviderImpl();
        authorizationParams = ConfigurationParameters.of(AccessControlConstants.PARAM_RESTRICTION_PROVIDER, restrictionProvider);
    }
    principalParams = configuration.getConfigValue(PrincipalConfiguration.NAME, EMPTY);
    tokenParams = configuration.getConfigValue(TokenConfiguration.NAME, EMPTY);
    return this;
}
Also used : UserAuthenticationFactory(org.apache.jackrabbit.oak.spi.security.user.UserAuthenticationFactory) RestrictionProvider(org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider) DefaultAuthorizableActionProvider(org.apache.jackrabbit.oak.spi.security.user.action.DefaultAuthorizableActionProvider) AuthorizableActionProvider(org.apache.jackrabbit.oak.spi.security.user.action.AuthorizableActionProvider) DefaultAuthorizableActionProvider(org.apache.jackrabbit.oak.spi.security.user.action.DefaultAuthorizableActionProvider) AuthorizableNodeName(org.apache.jackrabbit.oak.spi.security.user.AuthorizableNodeName) RestrictionProviderImpl(org.apache.jackrabbit.oak.security.authorization.restriction.RestrictionProviderImpl)

Aggregations

RestrictionProviderImpl (org.apache.jackrabbit.oak.security.authorization.restriction.RestrictionProviderImpl)1 RestrictionProvider (org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider)1 AuthorizableNodeName (org.apache.jackrabbit.oak.spi.security.user.AuthorizableNodeName)1 UserAuthenticationFactory (org.apache.jackrabbit.oak.spi.security.user.UserAuthenticationFactory)1 AuthorizableActionProvider (org.apache.jackrabbit.oak.spi.security.user.action.AuthorizableActionProvider)1 DefaultAuthorizableActionProvider (org.apache.jackrabbit.oak.spi.security.user.action.DefaultAuthorizableActionProvider)1