Class AnnotationPermissions
java.lang.Object
com.levigo.jadice.annotation.auth.web.AnnotationPermissions
Helper class for annotation permission checks. Can be used on the client and on the server side.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isAddAllowed
(Document document) Determines if annotations are allowed to be added to a document.static boolean
isChangeAllowed
(Annotation annotation) Determines if the given annotation may be changed.Only individual annotation permissions are taken into account.static boolean
isChangeAllowed
(Document document, Annotation... annotations) Determines if the given annotations may be changed on the given document.static boolean
isRemoveAllowed
(Annotation annotation) Determines if the annotations may be removed from a document.static boolean
isRemoveAllowed
(Document document, Annotation... annotations) Determines if the given annotations may be removed from the given document.static boolean
isShowAllowed
(Annotation annotation) Determines if the annotations have sufficient permissions to be shown in a viewer.static boolean
isShowAllowed
(Document document, Annotation... annotations) Determines if the given annotations are allowed to be shown in a viewer or a printout.
-
Constructor Details
-
AnnotationPermissions
public AnnotationPermissions()
-
-
Method Details
-
isChangeAllowed
Determines if the given annotations may be changed on the given document. Document and individual annotation permissions are taken into account.- Parameters:
document
- theDocument
in which the annotations resideannotations
- a set ofAnnotation
objects belonging to the document- Returns:
- true if is it allowed to change the given annotations of the given document
-
isChangeAllowed
Determines if the given annotation may be changed.Only individual annotation permissions are taken into account.- Parameters:
annotation
- anAnnotation
object- Returns:
- true if it is allowed to change the annotation
-
isRemoveAllowed
Determines if the given annotations may be removed from the given document. Document and individual annotation permissions are taken into account.- Parameters:
document
- theDocument
in which the annotations resideannotations
- a set ofAnnotation
objects belonging to the document- Returns:
- true if it is allowed to remove the annotations from the given document
-
isRemoveAllowed
Determines if the annotations may be removed from a document. Only individual annotation permissions are taken into account.- Parameters:
annotation
- anAnnotation
object- Returns:
- true if it is allowed to remove the given annotations from a document
-
isShowAllowed
Determines if the given annotations are allowed to be shown in a viewer or a printout. Document and individual annotation permissions are taken into account.- Parameters:
document
- theDocument
in which the annotations resideannotations
- a set ofAnnotation
objects belonging to the document- Returns:
- true if it is allowed to show the annotations of the given document in a viewer
-
isShowAllowed
Determines if the annotations have sufficient permissions to be shown in a viewer. Only individual annotation permissions are taken into account.- Parameters:
annotation
- anAnnotation
object- Returns:
- true if it is allowed to show the annotations in a viewer
-
isAddAllowed
Determines if annotations are allowed to be added to a document.- Parameters:
document
- theDocument
to add the annotations to- Returns:
- true if it is allowed to add annotations to the given document
-