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 theDefaultLoginModulethe existence of the user
 is checked in order to successfully complete the login. | 
| protected org.apache.jackrabbit.api.security.principal.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(Credentials creds,
              Subject subject,
              String workspaceName)Creates an AuthContext for the given  CredentialsandSubject.This includes selection of application specific LoginModules and initialization with credentials and Session to System-Workspace | 
| protected org.apache.jackrabbit.api.security.user.UserManager | getSystemUserManager(String workspaceName) | 
| org.apache.jackrabbit.api.security.user.UserManager | getUserManager(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(Repository repository,
    Session systemSession) | 
checkInitialized, getAccessManager, getAuthContextProvider, getConfig, getMembershipCache, getPrincipalManager, getPrincipalProviderRegistry, getRepository, getSystemSession, getUserIDpublic void init(Repository repository, Session systemSession) throws RepositoryException
init in interface JackrabbitSecurityManagerinit in class DefaultSecurityManagerRepositoryExceptionJackrabbitSecurityManager.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 org.apache.jackrabbit.api.security.user.UserManager getUserManager(Session session) throws RepositoryException
getUserManager in interface JackrabbitSecurityManagergetUserManager in class DefaultSecurityManagersession.UnsupportedRepositoryOperationException - If user management is
 not supported.RepositoryExceptionJackrabbitSecurityManager.getUserManager(javax.jcr.Session)public AuthContext getAuthContext(Credentials creds, Subject subject, String workspaceName) throws RepositoryException
Credentials and
 Subject.getAuthContext in interface JackrabbitSecurityManagergetAuthContext in class DefaultSecurityManagerworkspaceName - The name of the workspace to login.AuthContext for the given Credentials, SubjectRepositoryException - in other exceptional repository statesprotected PrincipalProvider createDefaultPrincipalProvider(Properties[] moduleConfig) throws RepositoryException
null. The default principal provider is
 workspace depending as users are expected to exist in every workspace.createDefaultPrincipalProvider in class DefaultSecurityManagernullRepositoryExceptionprotected org.apache.jackrabbit.api.security.user.UserManager getSystemUserManager(String workspaceName) throws RepositoryException
getSystemUserManager in class DefaultSecurityManagerworkspaceName - The name of the target workspace.RepositoryException - If an error occurs.protected UserManagerImpl createUserManager(SessionImpl session) throws RepositoryException
TransientChangeUserManagerImpl.createUserManager in class DefaultSecurityManagersession - sessionTransientChangeUserManagerImplRepositoryExceptionprotected org.apache.jackrabbit.api.security.principal.PrincipalManager createPrincipalManager(SessionImpl session) throws RepositoryException
createPrincipalManager in class DefaultSecurityManagersession - Session for the principal manager must be created.DefaultSecurityManager.getPrincipalProviderRegistry() but has a workspace specific
 default provider.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–2024 The Apache Software Foundation. All rights reserved.