public class UserPerWorkspaceSecurityManager extends DefaultSecurityManager
Session passed to getUserManager(Session).
In addition the default (user-based) principal provider created by
DefaultSecurityManager
cannot be used to retrieve principals. Instead this implementation keeps
a distinct pp-registry for each workspace.
adminId, anonymousId| Constructor and Description |
|---|
UserPerWorkspaceSecurityManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Disposes this security manager instance and cleans all internal caches.
|
protected PrincipalProvider |
createDefaultPrincipalProvider(Properties[] moduleConfig)
Always returns
null. |
protected WorkspaceAccessManager |
createDefaultWorkspaceAccessManager()
Returns a new instance of
SimpleWorkspaceAccessManager, since
with the DefaultLoginModule the existence of the user
is checked in order to successfully complete the login. |
protected PrincipalManager |
createPrincipalManager(SessionImpl session) |
protected UserManagerImpl |
createUserManager(SessionImpl session)
Creates a new instanceof
TransientChangeUserManagerImpl. |
void |
dispose(String workspaceName)
Disposes those parts of this security manager that are related to the
workspace indicated by the given
workspaceName. |
AuthContext |
getAuthContext(javax.jcr.Credentials creds,
Subject subject,
String workspaceName)
Creates an AuthContext for the given
Credentials and
Subject.This includes selection of application specific LoginModules and initialization with credentials and Session to System-Workspace |
protected UserManager |
getSystemUserManager(String workspaceName) |
UserManager |
getUserManager(javax.jcr.Session session)
As this implementation expects that users information in present in
every workspace, the UserManager is always created with the given
session.
|
void |
init(javax.jcr.Repository repository,
javax.jcr.Session systemSession) |
checkInitialized, getAccessManager, getAuthContextProvider, getConfig, getMembershipCache, getPrincipalManager, getPrincipalProviderRegistry, getRepository, getSystemSession, getUserIDpublic void init(javax.jcr.Repository repository,
javax.jcr.Session systemSession)
throws javax.jcr.RepositoryException
init in interface JackrabbitSecurityManagerinit in class DefaultSecurityManagerjavax.jcr.RepositoryExceptionJackrabbitSecurityManager.init(Repository, Session)public void dispose(String workspaceName)
JackrabbitSecurityManagerworkspaceName.dispose in interface JackrabbitSecurityManagerdispose in class DefaultSecurityManagerworkspaceName - Name of the workspace that is being disposed.JackrabbitSecurityManager.dispose(String)public void close()
JackrabbitSecurityManagerclose in interface JackrabbitSecurityManagerclose in class DefaultSecurityManagerJackrabbitSecurityManager.close()public UserManager getUserManager(javax.jcr.Session session) throws javax.jcr.RepositoryException
getUserManager in interface JackrabbitSecurityManagergetUserManager in class DefaultSecurityManagersession.javax.jcr.UnsupportedRepositoryOperationException - If user management is
not supported.javax.jcr.RepositoryExceptionJackrabbitSecurityManager.getUserManager(javax.jcr.Session)public AuthContext getAuthContext(javax.jcr.Credentials creds, Subject subject, String workspaceName) throws javax.jcr.RepositoryException
Credentials and
Subject.getAuthContext in interface JackrabbitSecurityManagergetAuthContext in class DefaultSecurityManagerworkspaceName - The name of the workspace to login.AuthContext for the given Credentials, Subjectjavax.jcr.RepositoryException - in other exceptional repository statesprotected PrincipalProvider createDefaultPrincipalProvider(Properties[] moduleConfig) throws javax.jcr.RepositoryException
null. The default principal provider is
workspace depending as users are expected to exist in every workspace.createDefaultPrincipalProvider in class DefaultSecurityManagernulljavax.jcr.RepositoryExceptionprotected UserManager getSystemUserManager(String workspaceName) throws javax.jcr.RepositoryException
getSystemUserManager in class DefaultSecurityManagerworkspaceName - The name of the target workspace.javax.jcr.RepositoryException - If an error occurs.protected UserManagerImpl createUserManager(SessionImpl session) throws javax.jcr.RepositoryException
TransientChangeUserManagerImpl.createUserManager in class DefaultSecurityManagersession - sessionTransientChangeUserManagerImpljavax.jcr.RepositoryExceptionprotected PrincipalManager createPrincipalManager(SessionImpl session) throws javax.jcr.RepositoryException
createPrincipalManager in class DefaultSecurityManagersession - Session for the principal manager must be created.DefaultSecurityManager.getPrincipalProviderRegistry() but has a workspace specific
default provider.javax.jcr.RepositoryExceptionprotected WorkspaceAccessManager createDefaultWorkspaceAccessManager()
SimpleWorkspaceAccessManager, since
with the DefaultLoginModule the existence of the user
is checked in order to successfully complete the login. Since with this
SecurityManager users are stored separately in each workspace, a user
may only login to a workspace if the corresponding user node exists.
Consequently a lazy workspace access manager is sufficient.
If this SecurityManager is used with a distinct LoginModule
implementation, the configuration
for WorkspaceAccessManager should be adjusted as well.
createDefaultWorkspaceAccessManager in class DefaultSecurityManagerSimpleWorkspaceAccessManager.Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.