Search in sources :

Example 1 with WorkspaceSecurityConfig

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;
}
Also used : WorkspaceSecurityConfig(org.apache.jackrabbit.core.config.WorkspaceSecurityConfig) AccessControlProvider(org.apache.jackrabbit.core.security.authorization.AccessControlProvider) WorkspaceConfig(org.apache.jackrabbit.core.config.WorkspaceConfig)

Aggregations

WorkspaceConfig (org.apache.jackrabbit.core.config.WorkspaceConfig)1 WorkspaceSecurityConfig (org.apache.jackrabbit.core.config.WorkspaceSecurityConfig)1 AccessControlProvider (org.apache.jackrabbit.core.security.authorization.AccessControlProvider)1