com.levigo.jadice.document
Interface Permission<D>

All Known Implementing Classes:
DocumentAnnotationPermission, DocumentAnnotationPermission.Factory.AbstractPerm, DocumentPermission, IndividualAnnotationPermission, IndividualAnnotationPermission.Factory.AbstractPerm, PageSegmentPermission

public interface Permission<D>

An interface to be implemented by permission voters. This interface is implicitly implemented by enum classes.


Nested Class Summary
static class Permission.Vote
           
 
Field Summary
static Permission<Object> DENY_ALL
          A special kind of permission which always denys any action.
static Permission<Object> GRANT_ALL
          A special kind of permission which always grants any action.
 
Method Summary
 boolean pertainsTo(Class<? extends Intent> intentClass)
          Return whether this permission pertains to the given action.
 Permission.Vote vote(D domain, Intent intent)
          Make a permission decision about the given intended action on the given domain object.
 

Field Detail

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 Detail

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


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.