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, getUserID
public void init(javax.jcr.Repository repository, javax.jcr.Session systemSession) throws javax.jcr.RepositoryException
init
in interface JackrabbitSecurityManager
init
in class DefaultSecurityManager
javax.jcr.RepositoryException
JackrabbitSecurityManager.init(Repository, Session)
public void dispose(String workspaceName)
JackrabbitSecurityManager
workspaceName
.dispose
in interface JackrabbitSecurityManager
dispose
in class DefaultSecurityManager
workspaceName
- Name of the workspace that is being disposed.JackrabbitSecurityManager.dispose(String)
public void close()
JackrabbitSecurityManager
close
in interface JackrabbitSecurityManager
close
in class DefaultSecurityManager
JackrabbitSecurityManager.close()
public UserManager getUserManager(javax.jcr.Session session) throws javax.jcr.RepositoryException
getUserManager
in interface JackrabbitSecurityManager
getUserManager
in class DefaultSecurityManager
session
.javax.jcr.UnsupportedRepositoryOperationException
- If user management is
not supported.javax.jcr.RepositoryException
JackrabbitSecurityManager.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 JackrabbitSecurityManager
getAuthContext
in class DefaultSecurityManager
workspaceName
- 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 DefaultSecurityManager
null
javax.jcr.RepositoryException
protected UserManager getSystemUserManager(String workspaceName) throws javax.jcr.RepositoryException
getSystemUserManager
in class DefaultSecurityManager
workspaceName
- 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 DefaultSecurityManager
session
- sessionTransientChangeUserManagerImpl
javax.jcr.RepositoryException
protected PrincipalManager createPrincipalManager(SessionImpl session) throws javax.jcr.RepositoryException
createPrincipalManager
in class DefaultSecurityManager
session
- Session for the principal manager must be created.DefaultSecurityManager.getPrincipalProviderRegistry()
but has a workspace specific
default provider.javax.jcr.RepositoryException
protected 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 DefaultSecurityManager
SimpleWorkspaceAccessManager
.Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.