Interface Permission<D>

All Known Implementing Classes:
DocumentAnnotationPermission, DocumentPermission, DocumentPermission, IndividualAnnotationPermission, UnconditionalPermission

public interface Permission<D>
An interface to be implemented by permission voters. This interface is implicitly implemented by enum classes.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Permission<Object>
    A special kind of permission which always denys any action.
    static final Permission<Object>
    A special kind of permission which always grants any action.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    pertainsTo(Class<? extends Intent> intentClass)
    Return whether this permission pertains to the given action.
    vote(D domain, Intent intent)
    Make a permission decision about the given intended action on the given domain object.
  • Field Details

    • GRANT_ALL

      static final Permission<Object> GRANT_ALL
      A special kind of permission which always grants any action.
    • DENY_ALL

      static final Permission<Object> DENY_ALL
      A special kind of permission which always denys any action.
  • Method Details

    • pertainsTo

      boolean pertainsTo(Class<? extends Intent> intentClass)
      Return whether this permission pertains to the given action. If this method returns true, this permission will be asked to make decisions about actions if the given class. Note to implementors: the vote(Object, Intent) method is guaranteed to never be called for actions of classes for which this method has returned false. You may therefore skip instanceof checks in the vote(Object, Intent) method, if you do them here.
      Parameters:
      intentClass -
      Returns:
      true if this method pertains to actions of the given class, false otherwise
    • vote

      Permission.Vote vote(D domain, Intent intent)
      Make a permission decision about the given intended action on the given domain object.
      Parameters:
      intent -
      Returns:
      the decision