Package org.nuxeo.ecm.core.api
Class UnrestrictedSessionRunner
java.lang.Object
org.nuxeo.ecm.core.api.UnrestrictedSessionRunner
- Direct Known Subclasses:
AbstractRootSectionsFinder
,AbstractUserWorkspaceImpl.UnrestrictedUserWorkspaceFinder
,ChangePermissionUnrestricted
,CoreGraph.ResourceFinder
,CoreGraph.SizeFinder
,CoreGraph.StatementAdder
,CoreGraph.StatementFinder
,CoreGraph.StatementRemover
,CoreProxyWithWorkflowFactory.DocumentPublisherUnrestricted
,CoreQueryAndFetchUnrestrictedSessionRunner
,CoreQueryUnrestrictedSessionRunner
,CreateDocumentsAction.UnrestrictedCreateDocument
,CreateTaskUnrestricted
,DefaultValidatorsRule.UnrestrictedACPGetter
,DeleteDocumentUnrestricted
,DocumentMetadataGroupComputer.GetDocumentsFromUsername
,DocumentRouteElementImpl.GetIsParentRunningUnrestricted
,DocumentRouteElementImpl.SetDocumentOnReadOnlyUnrestrictedSessionRunner
,DocumentRoutingServiceImpl.AttachedDocumentsChecker
,DocumentStoreSessionRunner
,DomainsFinder
,DublinCoreListener.UnrestrictedPropertySetter
,FollowTransitionUnrestricted
,JsonGraphRoute
,MultiTenantHelper.TenantIdFinder
,NodeAccessRunner
,PublishUnrestricted
,QueryRepositoryProbe.Runner
,RemoveACLUnrestricted
,RenditionCreator
,RenditionFinder
,RenditionLiveDocFetcher
,RenditionPublicationFactory.RemoveACP
,RenditionsRemover
,SourceDocumentResolver
,TaskServiceImpl.GetTaskRootParentPathUnrestricted
,TemplateMappingFetcher
,TemplateMappingRemover
,UserInvitationComponent.RegistrationAcceptator
,UserInvitationComponent.RegistrationApprover
,UserInvitationComponent.RegistrationCreator
,UserInvitationComponent.RegistrationRejector
,UserInvitationComponent.RequestIdValidator
,UserInvitationComponent.RootDocumentGetter
,UserInvitationComponent.UserRegistrationModelCreator
Helper class to run code with an unrestricted session.
The caller must implement the run()
method, and call runUnrestricted()
.
- Author:
- Florent Guillaume
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
True if a call torunUnrestricted()
is in progress.protected String
protected final String
protected CoreSession
protected final boolean
-
Constructor Summary
ModifierConstructorDescriptionprotected
UnrestrictedSessionRunner
(String repositoryName) Constructs aUnrestrictedSessionRunner
given a repository name.protected
UnrestrictedSessionRunner
(String repositoryName, String originatingUser) Constructs aUnrestrictedSessionRunner
given a repository name and an originating user name.protected
UnrestrictedSessionRunner
(CoreSession session) Constructs aUnrestrictedSessionRunner
given an existing session (which may or may not be already unrestricted). -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkUnrestricted
(CoreSession session) abstract void
run()
This method will be called byrunUnrestricted()
withsession
available as an unrestricted session.void
void
setOriginatingUsername
(String originatingUsername)
-
Field Details
-
originatingUsername
-
session
-
sessionIsAlreadyUnrestricted
protected final boolean sessionIsAlreadyUnrestricted -
repositoryName
-
isUnrestricted
protected boolean isUnrestrictedTrue if a call torunUnrestricted()
is in progress.
-
-
Constructor Details
-
UnrestrictedSessionRunner
Constructs aUnrestrictedSessionRunner
given an existing session (which may or may not be already unrestricted).Originating user is taken on given session.
- Parameters:
session
- the available session
-
UnrestrictedSessionRunner
Constructs aUnrestrictedSessionRunner
given a repository name.- Parameters:
repositoryName
- the repository name
-
UnrestrictedSessionRunner
Constructs aUnrestrictedSessionRunner
given a repository name and an originating user name.- Parameters:
repositoryName
- the repository nameoriginatingUser
- the user name behind the system user
-
-
Method Details
-
getOriginatingUsername
-
setOriginatingUsername
-
checkUnrestricted
-
runUnrestricted
public void runUnrestricted()Calls therun()
method with an unrestrictedsession
. During this call,isUnrestricted
is set totrue
. -
run
public abstract void run()This method will be called byrunUnrestricted()
withsession
available as an unrestricted session.It can also be called directly in which case the
session
available will be the one passed to#UnrestrictedSessionRunner(CoreSession)
.
-