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 booleanisAddAllowed(Document document) Determines if annotations are allowed to be added to a document.static booleanisChangeAllowed(Annotation annotation) Determines if the given annotation may be changed.Only individual annotation permissions are taken into account.static booleanisChangeAllowed(Document document, Annotation... annotations) Determines if the given annotations may be changed on the given document.static booleanisRemoveAllowed(Annotation annotation) Determines if the annotations may be removed from a document.static booleanisRemoveAllowed(Document document, Annotation... annotations) Determines if the given annotations may be removed from the given document.static booleanisShowAllowed(Annotation annotation) Determines if the annotations have sufficient permissions to be shown in a viewer.static booleanisShowAllowed(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- theDocumentin which the annotations resideannotations- a set ofAnnotationobjects 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- anAnnotationobject- 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- theDocumentin which the annotations resideannotations- a set ofAnnotationobjects 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- anAnnotationobject- 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- theDocumentin which the annotations resideannotations- a set ofAnnotationobjects 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- anAnnotationobject- 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- theDocumentto add the annotations to- Returns:
- true if it is allowed to add annotations to the given document
-