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: ca85780b27281c588b5e5164e18be383db8e2a0f $
    • 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
      • canUploadAttachment

        @Unstable
        default boolean canUploadAttachment​(String target,
                                            String userName)
        Checks if the user can upload attachment to the page as part of adding or editing an annotation.
        Parameters:
        target - the target of the page where to upload the attachment
        userName - the name of the user performing the upload
        Returns:
        true if the user can upload the attachment, false otherwise
        Since:
        14.10