Class UnconditionalPermission

java.lang.Object
com.levigo.jadice.document.auth.web.UnconditionalPermission
All Implemented Interfaces:
Permission<Object>

public class UnconditionalPermission extends Object implements Permission<Object>

A Permission implementation with a fixed Vote which pertains to any and all Intents. Attention: this class is a client-side adaption of the jadice document platform version. While using the jadice web toolkit, it is expected to use this version on the client at all times.

The default behavior is the following: on the server side, document platform permissions are automatically transformed into GWT-compatible permissions when sending data to the client. On the opposite way, i.e. sending a JSON-serialized version from client to server, the JSON-serialized permissions are transformed again into corresponding document platform versions.

  • Field Details

    • GRANT_ALL

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

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

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • vote

      public Permission.Vote vote(Object domain, Intent intent)
      Description copied from interface: Permission
      Make a permission decision about the given intended action on the given domain object.
      Specified by:
      vote in interface Permission<Object>
      Parameters:
      intent -
      Returns:
      the decision
    • pertainsTo

      public boolean pertainsTo(Class<? extends Intent> intentClass)
      Description copied from interface: Permission
      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 Permission.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 Permission.vote(Object, Intent) method, if you do them here.
      Specified by:
      pertainsTo in interface Permission<Object>
      Parameters:
      intentClass -
      Returns:
      true if this method pertains to actions of the given class, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object