use of org.apache.jackrabbit.core.config.WorkspaceSecurityConfig in project jackrabbit by apache.
the class DefaultSecurityManager method getAccessControlProvider.
//--------------------------------------------------------------------------
/**
* Returns the access control provider for the specified
* <code>workspaceName</code>.
*
* @param workspaceName Name of the workspace.
* @return access control provider
* @throws NoSuchWorkspaceException If no workspace with 'workspaceName' exists.
* @throws RepositoryException
*/
private AccessControlProvider getAccessControlProvider(String workspaceName) throws NoSuchWorkspaceException, RepositoryException {
checkInitialized();
AccessControlProvider provider = acProviders.get(workspaceName);
if (provider == null || !provider.isLive()) {
// mark this workspace as 'active' so the workspace does not
// get disposed by the workspace-janitor
// TODO: There should be a cleaner way to do this.
repository.markWorkspaceActive(workspaceName);
WorkspaceSecurityConfig secConf = null;
WorkspaceConfig conf = repository.getConfig().getWorkspaceConfig(workspaceName);
if (conf != null) {
secConf = conf.getSecurityConfig();
}
provider = acProviderFactory.createProvider(repository.getSystemSession(workspaceName), secConf);
synchronized (acProviders) {
acProviders.put(workspaceName, provider);
}
}
return provider;
}
Aggregations