Class AbstractEntityDocsGuardFactory

java.lang.Object
ch.tocco.nice2.dms.impl.security.guard.AbstractEntityDocsGuardFactory
All Implemented Interfaces:
GuardFactory
Direct Known Subclasses:
FolderGuardFactory, ResourceContentGuardFactory, ResourceGuardFactory

public abstract class AbstractEntityDocsGuardFactory extends Object implements GuardFactory
Base class with common functionality for entity docs GuardFactory implementations.
  • Field Details

  • Constructor Details

  • 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 interface GuardFactory
    • supports

      public final int[] supports(List<?> secured)
      Specified by:
      supports in interface GuardFactory
      Returns:
      the indices of the secured list that are supported by this factory
    • supportedEntities

      protected abstract List<EntityReference> supportedEntities(List<EntityReference> entityReferences)
      Returns:
      the number of given EntityReference that are supported by this guard.
    • getPrivilegedInvoker

      protected Invoker getPrivilegedInvoker()
    • getEntitiesFromSecuredObjects

      protected List<EntityReference> getEntitiesFromSecuredObjects(List<?> secured)
    • 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

      protected boolean isMailBoxFolder(@Nullable @Nullable Entity folder)