Class AbstractEntityDocsGuardFactory
java.lang.Object
ch.tocco.nice2.dms.impl.security.guard.AbstractEntityDocsGuardFactory
- All Implemented Interfaces:
GuardFactory
- Direct Known Subclasses:
FolderGuardFactory
,ResourceContentGuardFactory
,ResourceGuardFactory
Base class with common functionality for entity docs
GuardFactory
implementations.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
A base class for custom entity document guards. -
Field Summary
Modifier and TypeFieldDescriptionprotected final BusinessUnitManager
protected final DataModel
protected final PersistenceService
protected final SecurityManager
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractEntityDocsGuardFactory
(SecurityManager securityManager, BusinessUnitManager businessUnitManager, DataModel dataModel, PersistenceService persistenceService) -
Method Summary
Modifier and TypeMethodDescriptionprotected List
<EntityReference> getEntitiesFromSecuredObjects
(List<?> secured) protected Invoker
protected boolean
isMailBoxFolder
(@Nullable Entity folder) protected Map
<Serializable, Serializable> loadRelatedEntityKeys
(String targetEntity, com.google.common.collect.Multimap<String, Serializable> entityModelToKeys) Loads all primary keys of the related entities of a given list of Resource or Folder keys.int
priority()
if multiple factories support a specific secured objects, the one with the highest priority will be used.protected abstract List
<EntityReference> supportedEntities
(List<EntityReference> entityReferences) final int[]
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.security.api.GuardFactory
createGuard
-
Field Details
-
securityManager
-
businessUnitManager
-
dataModel
-
persistenceService
-
-
Constructor Details
-
AbstractEntityDocsGuardFactory
protected AbstractEntityDocsGuardFactory(SecurityManager securityManager, BusinessUnitManager businessUnitManager, DataModel dataModel, PersistenceService persistenceService)
-
-
Method Details
-
priority
public int priority()Description copied from interface:GuardFactory
if multiple factories support a specific secured objects, the one with the highest priority will be used.- Specified by:
priority
in interfaceGuardFactory
-
supports
- Specified by:
supports
in interfaceGuardFactory
- Returns:
- the indices of the secured list that are supported by this factory
-
supportedEntities
- Returns:
- the number of given
EntityReference
that are supported by this guard.
-
getPrivilegedInvoker
-
getEntitiesFromSecuredObjects
-
loadRelatedEntityKeys
protected Map<Serializable,Serializable> loadRelatedEntityKeys(String targetEntity, com.google.common.collect.Multimap<String, Serializable> entityModelToKeys) Loads all primary keys of the related entities of a given list of Resource or Folder keys.- Returns:
- a map that maps the key of the Folder/Resource to the key of the related entity
-
isMailBoxFolder
-