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
Nested ClassesModifier and TypeClassDescriptionprotected static classA base class for custom entity document guards. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BusinessUnitManagerprotected final DataModelprotected final PersistenceServiceprotected final SecurityManager -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractEntityDocsGuardFactory(SecurityManager securityManager, BusinessUnitManager businessUnitManager, DataModel dataModel, PersistenceService persistenceService) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<EntityReference> getEntitiesFromSecuredObjects(List<?> secured) protected Invokerprotected booleanisMailBoxFolder(@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.intpriority()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, waitMethods 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:GuardFactoryif multiple factories support a specific secured objects, the one with the highest priority will be used.- Specified by:
priorityin interfaceGuardFactory
-
supports
- Specified by:
supportsin interfaceGuardFactory- Returns:
- the indices of the secured list that are supported by this factory
-
supportedEntities
- Returns:
- the number of given
EntityReferencethat 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
-