Class EntitySecurityDomain

All Implemented Interfaces:
SecurityDomain

@Component public class EntitySecurityDomain extends AbstractEntitySecurityDomain<EntityReference,EntityModel>
  • Constructor Details

  • Method Details

    • aggregateSupportedObjects

      public List<List<?>> aggregateSupportedObjects(List<?> securedObjects)
      Description copied from interface: SecurityDomain
      This method should group all secured objects, which can be evaluated together in a ListGuard, and return a list of these groups. This means all objects in a sub-list must require the same policy, (every object in the list would select the same rules of a policy, see SecurityDomain.getSelectorFactory()). Secured objects that are not supported by this domain at all should not be returned from this method. If none of the objects are supported, an empty list should be returned.
    • getSelectorFactory

      public SelectorFactory getSelectorFactory()
      Description copied from interface: SecurityDomain
      Create a selector factory. A selector factory is an object which creates selectors. There is no interface as the arguments defined in the policy will be matched to factory methods using reflection. The contract for the object returned by this method is as follows:

      It specify several methods called createSelector with the return type Selector. It may take any number of arguments. Supported argument types are all Java primitives, String, enumerations and arrays of enumerations. The last argument may be an array, which indicates varargs. Wildcards will be passed as null. The methods may throw an InvalidArgumentException.

      Returns:
      The selector factory.
    • getEntityReferences

      protected List<EntityReference> getEntityReferences(List<EntityReference> secured)
      Specified by:
      getEntityReferences in class AbstractEntitySecurityDomain<EntityReference,EntityModel>
    • createCacheKey

      protected EntityModel createCacheKey(List<?> objects)
      Only use one guard instance per security context and model.
      Specified by:
      createCacheKey in class GuardCachingSecurityDomain<EntityModel>
    • buildCache

      protected com.google.common.cache.Cache<EntityModel,Policy> buildCache()
      Specified by:
      buildCache in class GuardCachingSecurityDomain<EntityModel>