Class AbstractSecurityDomain

java.lang.Object
ch.tocco.nice2.security.spi.AbstractSecurityDomain
All Implemented Interfaces:
SecurityDomain
Direct Known Subclasses:
ActionSecurityDomain, AdminMenuSecurityDomain, InfoboxSecurityDomain, ManagerSecurityDomain, ReportSecurityDomain

public abstract class AbstractSecurityDomain extends Object implements SecurityDomain
Base class for a simple SecurityDomain that is not used very extensively. These domains do not support evaluating multiple secured objects at once (because each object uses a different policy). Since they also do not support conditions there is no benefit to evaluate them together anyway. Policies are currently not cached, because these domains are not used very often.
  • Constructor Details

    • AbstractSecurityDomain

      public AbstractSecurityDomain()
  • 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.
      Specified by:
      aggregateSupportedObjects in interface SecurityDomain
    • getSupportedClasses

      protected abstract Class<?>[] getSupportedClasses()
    • getOrCreateFilteredPolicy

      public Policy getOrCreateFilteredPolicy(SecurityContext securityContext, List<?> objects, Callable<Policy> provider) throws Exception
      Description copied from interface: SecurityDomain
      Return a policy for the given objects. This can be used to cache and reuse policies for different objects. If no cached policy is available, the given Callable can be used to create a new one.
      Specified by:
      getOrCreateFilteredPolicy in interface SecurityDomain
      Throws:
      Exception
    • clearGuardCache

      public void clearGuardCache(SecurityContext securityContext)
      Description copied from interface: SecurityDomain
      Clear all cached objects belonging to the given security context.
      Specified by:
      clearGuardCache in interface SecurityDomain