Package io.jmix.webdav.tools.impl
Class WebdavSecurityToolsImpl
java.lang.Object
io.jmix.webdav.tools.impl.WebdavSecurityToolsImpl
- All Implemented Interfaces:
WebdavSecurityTools
@Component("webdav_WebdavSecurityTools")
public class WebdavSecurityToolsImpl
extends Object
implements WebdavSecurityTools
-
Field Summary
Modifier and TypeFieldDescriptionprotected AccessManager
protected org.springframework.context.ApplicationContext
protected CurrentAuthentication
protected DataManager
protected jakarta.persistence.EntityManager
protected EntityStates
protected Metadata
protected PolicyStore
protected ReferenceIdProvider
protected SecureOperations
protected org.springframework.transaction.support.TransactionTemplate
-
Constructor Summary
ConstructorDescriptionWebdavSecurityToolsImpl
(DataManager dataManager, EntityStates entityStates, Metadata metadata, SecureOperations secureOperations, PolicyStore policyStore, AccessManager accessManager, CurrentAuthentication currentAuthentication, ReferenceIdProvider referenceIdProvider, org.springframework.context.ApplicationContext applicationContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkUserCanCreateDocument
(WebdavDocument document) void
checkUserCanCreateDocumentVersion
(WebdavDocumentVersion documentVersion) void
checkUserCanDeleteDocument
(WebdavDocument document) void
checkUserCanDeleteDocumentVersion
(WebdavDocumentVersion documentVersion) void
void
void
void
void
checkUserCanLockDocument
(WebdavDocument document, WebdavLockDescriptor lockDescriptor) void
checkUserCanReadDocument
(WebdavDocument document) Method always does silent exit, because user already has instance of WebdavDocumentvoid
checkUserCanReadDocumentById
(UUID documentId) void
checkUserCanReadDocumentByWebdavDocumentVersion
(WebdavDocumentVersion documentVersion) void
checkUserCanReadDocumentVersion
(WebdavDocumentVersion documentVersion) void
checkUserCanReadDocumentVersionById
(UUID documentVersionId) void
checkUserCanUnlockDocument
(WebdavDocument document, WebdavLockDescriptor lock) void
checkUserCanUpdateDocument
(WebdavDocument document, WebdavDocumentVersion documentVersion) void
checkUserCanUpdateDocumentVersion
(WebdavDocumentVersion documentVersion) void
checkUserIsLockOwner
(WebdavDocument document) protected LoadContext<WebdavDocument>
createLoadContextIsUserPermittedToReadDocument
(UUID documentId) protected InMemoryCrudEntityContext
protected InMemoryCrudEntityContext
protected InMemoryCrudEntityContext
protected boolean
internalIsUserPermittedToReadDocumentVersion
(Supplier<WebdavDocumentVersion> documentVersionLoader) boolean
isUserLockOwner
(WebdavDocument document) boolean
boolean
boolean
isUserPermittedToCreateDocumentVersion
(WebdavDocumentVersion documentVersion) boolean
boolean
boolean
isUserPermittedToDeleteDocumentVersion
(WebdavDocumentVersion documentVersion) boolean
boolean
boolean
boolean
boolean
boolean
isUserPermittedToLockDocument
(WebdavDocument document, WebdavLockDescriptor lock) boolean
isUserPermittedToReadDocument
(WebdavDocument document) Method always returns true, because user already has instance of WebdavDocumentboolean
isUserPermittedToReadDocumentById
(UUID documentId) boolean
boolean
isUserPermittedToReadDocumentVersion
(WebdavDocumentVersion documentVersion) boolean
isUserPermittedToReadDocumentVersionById
(UUID documentVersionId) boolean
isUserPermittedToReadParentCollectionForDocument
(WebdavDocument webdavDocument) boolean
isUserPermittedToUnlockDocument
(WebdavDocument document, WebdavLockDescriptor lock) boolean
isUserPermittedToUpdateDocument
(WebdavDocument document, WebdavDocumentVersion documentVersion) boolean
boolean
isUserPermittedToUpdateDocumentVersion
(WebdavDocumentVersion documentVersion) boolean
isUserPermittedToUpdateParentCollectionForDocument
(WebdavDocument webdavDocument) protected UUID
retrieveWebdavDocumentReferenceId
(WebdavDocumentVersion loadedDocumentVersion) protected void
setTransactionManager
(org.springframework.transaction.PlatformTransactionManager transactionManager)
-
Field Details
-
dataManager
-
entityStates
-
metadata
-
secureOperations
-
policyStore
-
accessManager
-
currentAuthentication
-
referenceIdProvider
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
entityManager
protected jakarta.persistence.EntityManager entityManager -
transaction
protected org.springframework.transaction.support.TransactionTemplate transaction
-
-
Constructor Details
-
WebdavSecurityToolsImpl
public WebdavSecurityToolsImpl(DataManager dataManager, EntityStates entityStates, Metadata metadata, SecureOperations secureOperations, PolicyStore policyStore, AccessManager accessManager, CurrentAuthentication currentAuthentication, ReferenceIdProvider referenceIdProvider, org.springframework.context.ApplicationContext applicationContext)
-
-
Method Details
-
setTransactionManager
@Autowired protected void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) -
checkUserCanReadDocumentById
- Specified by:
checkUserCanReadDocumentById
in interfaceWebdavSecurityTools
-
isUserPermittedToReadDocumentById
- Specified by:
isUserPermittedToReadDocumentById
in interfaceWebdavSecurityTools
-
createLoadContextIsUserPermittedToReadDocument
protected LoadContext<WebdavDocument> createLoadContextIsUserPermittedToReadDocument(UUID documentId) -
checkUserCanReadDocument
Description copied from interface:WebdavSecurityTools
Method always does silent exit, because user already has instance of WebdavDocument- Specified by:
checkUserCanReadDocument
in interfaceWebdavSecurityTools
- Parameters:
document
- reference on loaded from database instance
-
isUserPermittedToReadDocument
Description copied from interface:WebdavSecurityTools
Method always returns true, because user already has instance of WebdavDocument- Specified by:
isUserPermittedToReadDocument
in interfaceWebdavSecurityTools
- Parameters:
document
- reference on loaded from database instance
-
checkUserCanReadDocumentByWebdavDocumentVersion
- Specified by:
checkUserCanReadDocumentByWebdavDocumentVersion
in interfaceWebdavSecurityTools
-
checkUserCanGetPossibleReadDocument
public void checkUserCanGetPossibleReadDocument()- Specified by:
checkUserCanGetPossibleReadDocument
in interfaceWebdavSecurityTools
-
isUserPermittedToGetPossibleReadDocument
public boolean isUserPermittedToGetPossibleReadDocument()- Specified by:
isUserPermittedToGetPossibleReadDocument
in interfaceWebdavSecurityTools
-
checkUserCanGetPossibleUpdateDocument
- Specified by:
checkUserCanGetPossibleUpdateDocument
in interfaceWebdavSecurityTools
-
isUserPermittedToGetPossibleUpdateDocument
- Specified by:
isUserPermittedToGetPossibleUpdateDocument
in interfaceWebdavSecurityTools
-
checkUserCanUpdateDocument
public void checkUserCanUpdateDocument(WebdavDocument document, WebdavDocumentVersion documentVersion) - Specified by:
checkUserCanUpdateDocument
in interfaceWebdavSecurityTools
-
isUserPermittedToUpdateDocument
public boolean isUserPermittedToUpdateDocument(WebdavDocument document, WebdavDocumentVersion documentVersion) - Specified by:
isUserPermittedToUpdateDocument
in interfaceWebdavSecurityTools
-
checkUserCanCreateDocument
- Specified by:
checkUserCanCreateDocument
in interfaceWebdavSecurityTools
-
isUserPermittedToCreateDocument
- Specified by:
isUserPermittedToCreateDocument
in interfaceWebdavSecurityTools
-
checkUserCanDeleteDocument
- Specified by:
checkUserCanDeleteDocument
in interfaceWebdavSecurityTools
-
isUserPermittedToDeleteDocument
- Specified by:
isUserPermittedToDeleteDocument
in interfaceWebdavSecurityTools
-
checkUserCanGetPossibleLockDocument
- Specified by:
checkUserCanGetPossibleLockDocument
in interfaceWebdavSecurityTools
-
isUserPermittedToGetPossibleLockDocument
- Specified by:
isUserPermittedToGetPossibleLockDocument
in interfaceWebdavSecurityTools
-
checkUserCanLockDocument
- Specified by:
checkUserCanLockDocument
in interfaceWebdavSecurityTools
-
isUserPermittedToLockDocument
- Specified by:
isUserPermittedToLockDocument
in interfaceWebdavSecurityTools
-
checkUserCanUnlockDocument
- Specified by:
checkUserCanUnlockDocument
in interfaceWebdavSecurityTools
-
isUserPermittedToGetPossibleUnlockDocument
- Specified by:
isUserPermittedToGetPossibleUnlockDocument
in interfaceWebdavSecurityTools
-
isUserPermittedToUnlockDocument
- Specified by:
isUserPermittedToUnlockDocument
in interfaceWebdavSecurityTools
-
checkUserIsLockOwner
- Specified by:
checkUserIsLockOwner
in interfaceWebdavSecurityTools
-
isUserLockOwner
- Specified by:
isUserLockOwner
in interfaceWebdavSecurityTools
-
checkUserCanCreateDocumentVersion
- Specified by:
checkUserCanCreateDocumentVersion
in interfaceWebdavSecurityTools
-
isUserPermittedToCreateDocumentVersion
- Specified by:
isUserPermittedToCreateDocumentVersion
in interfaceWebdavSecurityTools
-
checkUserCanGetPossibleReadDocumentVersion
public void checkUserCanGetPossibleReadDocumentVersion()- Specified by:
checkUserCanGetPossibleReadDocumentVersion
in interfaceWebdavSecurityTools
-
isUserPermittedToGetPossibleReadDocumentVersion
public boolean isUserPermittedToGetPossibleReadDocumentVersion()- Specified by:
isUserPermittedToGetPossibleReadDocumentVersion
in interfaceWebdavSecurityTools
-
checkUserCanReadDocumentVersionById
- Specified by:
checkUserCanReadDocumentVersionById
in interfaceWebdavSecurityTools
-
checkUserCanReadDocumentVersion
- Specified by:
checkUserCanReadDocumentVersion
in interfaceWebdavSecurityTools
-
checkUserCanUpdateDocumentVersion
- Specified by:
checkUserCanUpdateDocumentVersion
in interfaceWebdavSecurityTools
-
isUserPermittedToUpdateDocumentVersion
- Specified by:
isUserPermittedToUpdateDocumentVersion
in interfaceWebdavSecurityTools
-
checkUserCanDeleteDocumentVersion
- Specified by:
checkUserCanDeleteDocumentVersion
in interfaceWebdavSecurityTools
-
isUserPermittedToDeleteDocumentVersion
- Specified by:
isUserPermittedToDeleteDocumentVersion
in interfaceWebdavSecurityTools
-
isUserPermittedToReadParentCollectionForDocument
- Specified by:
isUserPermittedToReadParentCollectionForDocument
in interfaceWebdavSecurityTools
-
isUserPermittedToUpdateParentCollectionForDocument
- Specified by:
isUserPermittedToUpdateParentCollectionForDocument
in interfaceWebdavSecurityTools
-
isUserPermittedToCreateDocumentByWebdavDocumentVersion
public boolean isUserPermittedToCreateDocumentByWebdavDocumentVersion(WebdavDocumentVersion documentVersion) - Specified by:
isUserPermittedToCreateDocumentByWebdavDocumentVersion
in interfaceWebdavSecurityTools
-
isUserPermittedToReadDocumentByWebdavDocumentVersion
public boolean isUserPermittedToReadDocumentByWebdavDocumentVersion(WebdavDocumentVersion documentVersion) - Specified by:
isUserPermittedToReadDocumentByWebdavDocumentVersion
in interfaceWebdavSecurityTools
-
isUserPermittedToUpdateDocumentByWebdavDocumentVersion
public boolean isUserPermittedToUpdateDocumentByWebdavDocumentVersion(WebdavDocumentVersion documentVersion) - Specified by:
isUserPermittedToUpdateDocumentByWebdavDocumentVersion
in interfaceWebdavSecurityTools
-
isUserPermittedToDeleteDocumentByWebdavDocumentVersion
public boolean isUserPermittedToDeleteDocumentByWebdavDocumentVersion(WebdavDocumentVersion documentVersion) - Specified by:
isUserPermittedToDeleteDocumentByWebdavDocumentVersion
in interfaceWebdavSecurityTools
-
isUserPermittedToReadDocumentVersionById
- Specified by:
isUserPermittedToReadDocumentVersionById
in interfaceWebdavSecurityTools
-
isUserPermittedToReadDocumentVersion
- Specified by:
isUserPermittedToReadDocumentVersion
in interfaceWebdavSecurityTools
-
internalIsUserPermittedToReadDocumentVersion
protected boolean internalIsUserPermittedToReadDocumentVersion(Supplier<WebdavDocumentVersion> documentVersionLoader) -
retrieveWebdavDocumentReferenceId
@Nullable protected UUID retrieveWebdavDocumentReferenceId(WebdavDocumentVersion loadedDocumentVersion) -
createWebdavDocumentAccessContext
-
createWebdavDocumentVersionAccessContext
-
createWebdavLockDescriptorAccessContext
-