Class PermissionSyncRootFactory
- java.lang.Object
-
- org.nuxeo.drive.service.impl.AbstractFileSystemItemFactory
-
- org.nuxeo.drive.service.impl.AbstractSyncRootFolderItemFactory
-
- org.nuxeo.drive.hierarchy.permission.factory.PermissionSyncRootFactory
-
- All Implemented Interfaces:
FileSystemItemFactory
public class PermissionSyncRootFactory extends AbstractSyncRootFolderItemFactory
Permission based implementation ofFileSystemItemFactory
for a synchronization rootFolderItem
.- Author:
- Antoine Taillefer
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
REQUIRED_PERMISSION_PARAM
protected String
requiredPermission
protected static String
SHARED_SYNC_ROOT_PARENT_FACTORY_PARAM
protected String
sharedSyncRootParentFactoryName
protected static String
USER_SYNC_ROOT_PARENT_FACTORY_PARAM
protected String
userSyncRootParentFactoryName
-
Fields inherited from class org.nuxeo.drive.service.impl.AbstractFileSystemItemFactory
name
-
-
Constructor Summary
Constructors Constructor Description PermissionSyncRootFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FileSystemItem
adaptDocument(DocumentModel doc, boolean forceParentId, FolderItem parentItem, boolean relaxSyncRootConstraint, boolean getLockInfo)
Adapts the givenDocumentModel
to aFileSystemItem
.protected FileSystemItemAdapterService
getFileSystemAdapterService()
protected FolderItem
getParentItem(DocumentModel doc)
Returns the parentFileSystemItem
.void
handleParameters(Map<String,String> parameters)
No parameters by default.boolean
isFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)
Checks if the givenDocumentModel
is adaptable as aFileSystemItem
.-
Methods inherited from class org.nuxeo.drive.service.impl.AbstractSyncRootFolderItemFactory
getFileSystemItem, getFileSystemItem, getFileSystemItem
-
Methods inherited from class org.nuxeo.drive.service.impl.AbstractFileSystemItemFactory
adaptDocument, canHandleFileSystemItemId, exists, getDocumentById, getFileSystemItem, getFileSystemItem, getFileSystemItem, getFileSystemItem, getFileSystemItem, getFileSystemItem, getFileSystemItemById, getFileSystemItemById, getName, isFileSystemItem, isFileSystemItem, parseFileSystemId, setName
-
-
-
-
Field Detail
-
REQUIRED_PERMISSION_PARAM
protected static final String REQUIRED_PERMISSION_PARAM
- See Also:
- Constant Field Values
-
USER_SYNC_ROOT_PARENT_FACTORY_PARAM
protected static final String USER_SYNC_ROOT_PARENT_FACTORY_PARAM
- See Also:
- Constant Field Values
-
SHARED_SYNC_ROOT_PARENT_FACTORY_PARAM
protected static final String SHARED_SYNC_ROOT_PARENT_FACTORY_PARAM
- See Also:
- Constant Field Values
-
requiredPermission
protected String requiredPermission
-
userSyncRootParentFactoryName
protected String userSyncRootParentFactoryName
-
sharedSyncRootParentFactoryName
protected String sharedSyncRootParentFactoryName
-
-
Method Detail
-
handleParameters
public void handleParameters(Map<String,String> parameters)
Description copied from class:AbstractSyncRootFolderItemFactory
No parameters by default.- Specified by:
handleParameters
in interfaceFileSystemItemFactory
- Overrides:
handleParameters
in classAbstractSyncRootFolderItemFactory
-
isFileSystemItem
public boolean isFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)
Checks if the givenDocumentModel
is adaptable as aFileSystemItem
. The permission synchronization root factory considers that aDocumentModel
is adaptable as aFileSystemItem
if:- It is Folderish
- AND it is not a version nor a proxy
- AND it is not HiddenInNavigation
- AND it is not in the trash, unless
includeDeleted
is true - AND it is a synchronization root registered for the current user, unless
relaxSyncRootConstraint
is true - AND the current user has the
requiredPermission
permission on the document
- Specified by:
isFileSystemItem
in interfaceFileSystemItemFactory
- Overrides:
isFileSystemItem
in classAbstractSyncRootFolderItemFactory
-
adaptDocument
protected FileSystemItem adaptDocument(DocumentModel doc, boolean forceParentId, FolderItem parentItem, boolean relaxSyncRootConstraint, boolean getLockInfo)
Description copied from class:AbstractFileSystemItemFactory
Adapts the givenDocumentModel
to aFileSystemItem
.
-
getParentItem
protected FolderItem getParentItem(DocumentModel doc)
Description copied from class:AbstractSyncRootFolderItemFactory
Returns the parentFileSystemItem
.- Specified by:
getParentItem
in classAbstractSyncRootFolderItemFactory
-
getFileSystemAdapterService
protected FileSystemItemAdapterService getFileSystemAdapterService()
-
-