use of org.apache.jackrabbit.oak.spi.security.user.action.DefaultAuthorizableActionProvider 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;
}
Aggregations