Interface AnnotationRightService


  • @Role
    public interface AnnotationRightService
    Service to provide functions to check access rights to annotations actions (viewing, adding annotations, editing).
    Since:
    2.3M1
    Version:
    $Id: 409ac1a23dd953fe4cdbccde7e5770c24bb12812 $
    • Method Detail

      • canViewAnnotations

        boolean canViewAnnotations​(String target,
                                   String userName)
        Checks if the specified user can view the annotations on the specific target.
        Parameters:
        target - the target of the annotations to view
        userName - the name of the user to view the annotations
        Returns:
        true if the user can view the annotations on the passed target, false otherwise
      • canViewAnnotatedTarget

        boolean canViewAnnotatedTarget​(String target,
                                       String userName)
        Checks if the specified user can view the passed target annotated (which implies view on the target itself and the ability to view the annotations).
        Parameters:
        target - the target to view annotated
        userName - the name of the user to view the annotated target
        Returns:
        true if the user can see the target annotated, false otherwise.
      • canAddAnnotation

        boolean canAddAnnotation​(String target,
                                 String userName)
        Checks if the user can add annotations on the specified target.
        Parameters:
        target - the target on which to add annotations
        userName - the name of the user to add annotations
        Returns:
        true if the user can annotate the target, false otherwise
      • canEditAnnotation

        boolean canEditAnnotation​(String annotationId,
                                  String target,
                                  String userName)
        Checks if the user can edit the specified annotation.
        Parameters:
        target - the target of the annotation to edit
        userName - the name of the user to edit the annotation
        annotationId - the id of the annotation to be edited
        Returns:
        true if the user can edit the annotation, false otherwise