Class DefaultListGuard

java.lang.Object
ch.tocco.nice2.security.api.AbstractListGuard
ch.tocco.nice2.security.spi.DefaultListGuard
All Implemented Interfaces:
ListGuard

public class DefaultListGuard extends AbstractListGuard
A default ListGuard implementation which is based on the current security Policy (which is based on *.acl files). This class can be extended for custom behaviour.
  • Field Details

    • log

      protected final org.slf4j.Logger log
    • manager

      protected final SecurityManager manager
  • Constructor Details

  • Method Details

    • getPrincipal

      public Principal getPrincipal()
    • getSecured

      public List<?> getSecured()
      Returns:
      The objects this guard is protecting.
    • getSecurityContext

      public SecurityContext getSecurityContext()
    • evaluatePermissions

      public Guard.Decision[] evaluatePermissions(Permission permission)
      Description copied from interface: ListGuard
      Evaluates a permission. This method returns an Guard.Decision providing some more information about *why* a permission is granted or denied.
      Parameters:
      permission - The permission to evaluate.
      Returns:
      An Guard.Decision.
    • doEvaluatePermissions

      public Guard.Decision[] doEvaluatePermissions(Permission permission, Guard.Decision[] initialDecision)
    • toGuard

      public Guard toGuard()
      Description copied from interface: ListGuard
      Returns a Guard instance based on this ListGuard. This is only supported if this list guard contains exactly one object.
    • toArray

      protected Guard.Decision[] toArray(Guard.Decision decision, int times)
    • toList

      protected <E> List<E> toList(@Nullable E value, int times)