Package com.levigo.jadice.document
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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 TypeMethodDescriptionboolean
pertainsTo
(Class<? extends Intent> intentClass) Return whether this permission pertains to the given action.Make a permission decision about the given intended action on the given domain object.
-
Field Details
-
GRANT_ALL
A special kind of permission which always grants any action. -
DENY_ALL
A special kind of permission which always denys any action.
-
-
Method Details
-
pertainsTo
Return whether this permission pertains to the given action. If this method returnstrue
, this permission will be asked to make decisions about actions if the given class. Note to implementors: thevote(Object, Intent)
method is guaranteed to never be called for actions of classes for which this method has returned false. You may therefore skipinstanceof
checks in thevote(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
Make a permission decision about the given intended action on the given domain object.- Parameters:
intent
-- Returns:
- the decision
-