Class AnnotationPermissions

java.lang.Object
com.levigo.jadice.annotation.auth.web.AnnotationPermissions

public class AnnotationPermissions extends Object
Helper class for annotation permission checks. Can be used on the client and on the server side.
  • Constructor Details

    • AnnotationPermissions

      public AnnotationPermissions()
  • Method Details

    • isChangeAllowed

      public static boolean isChangeAllowed(Document document, Annotation... annotations)
      Determines if the given annotations may be changed on the given document. Document and individual annotation permissions are taken into account.
      Parameters:
      document - the Document in which the annotations reside
      annotations - a set of Annotation objects belonging to the document
      Returns:
      true if is it allowed to change the given annotations of the given document
    • isChangeAllowed

      public static boolean isChangeAllowed(Annotation annotation)
      Determines if the given annotation may be changed.Only individual annotation permissions are taken into account.
      Parameters:
      annotation - an Annotation object
      Returns:
      true if it is allowed to change the annotation
    • isRemoveAllowed

      public static boolean isRemoveAllowed(Document document, Annotation... annotations)
      Determines if the given annotations may be removed from the given document. Document and individual annotation permissions are taken into account.
      Parameters:
      document - the Document in which the annotations reside
      annotations - a set of Annotation objects belonging to the document
      Returns:
      true if it is allowed to remove the annotations from the given document
    • isRemoveAllowed

      public static boolean isRemoveAllowed(Annotation annotation)
      Determines if the annotations may be removed from a document. Only individual annotation permissions are taken into account.
      Parameters:
      annotation - an Annotation object
      Returns:
      true if it is allowed to remove the given annotations from a document
    • isShowAllowed

      public static boolean isShowAllowed(Document document, Annotation... annotations)
      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 - the Document in which the annotations reside
      annotations - a set of Annotation objects belonging to the document
      Returns:
      true if it is allowed to show the annotations of the given document in a viewer
    • isShowAllowed

      public static boolean isShowAllowed(Annotation annotation)
      Determines if the annotations have sufficient permissions to be shown in a viewer. Only individual annotation permissions are taken into account.
      Parameters:
      annotation - an Annotation object
      Returns:
      true if it is allowed to show the annotations in a viewer
    • isAddAllowed

      public static boolean isAddAllowed(Document document)
      Determines if annotations are allowed to be added to a document.
      Parameters:
      document - the Document to add the annotations to
      Returns:
      true if it is allowed to add annotations to the given document