use of org.apache.jackrabbit.core.security.authorization.acl.ACLProvider in project jackrabbit by apache.
the class AccessControlProviderFactoryImpl method createProvider.
/**
* @see AccessControlProviderFactory#createProvider(Session, WorkspaceSecurityConfig)
*/
public AccessControlProvider createProvider(Session systemSession, WorkspaceSecurityConfig config) throws RepositoryException {
String workspaceName = systemSession.getWorkspace().getName();
AccessControlProvider prov;
Map props;
if (config != null && config.getAccessControlProviderConfig() != null) {
BeanConfig bc = config.getAccessControlProviderConfig();
prov = bc.newInstance(AccessControlProvider.class);
props = bc.getParameters();
} else {
log.debug("No ac-provider configuration for workspace " + workspaceName + " -> using defaults.");
if (workspaceName.equals(secWorkspaceName) && !workspaceName.equals(defaultWorkspaceName)) {
// UserAccessControlProvider is designed to work with an extra
// workspace storing user and groups. therefore avoid returning
// this ac provider for the default workspace.
prov = new UserAccessControlProvider();
} else {
prov = new ACLProvider();
}
log.debug("Default provider for workspace " + workspaceName + " = " + prov.getClass().getName());
props = Collections.emptyMap();
}
prov.init(systemSession, props);
return prov;
}
Aggregations