Package org.xwiki.annotation.rights
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canAddAnnotation(String target, String userName)
Checks if the user can add annotations on the specified target.boolean
canEditAnnotation(String annotationId, String target, String userName)
Checks if the user can edit the specified annotation.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).boolean
canViewAnnotations(String target, String userName)
Checks if the specified user can view the annotations on the specific target.
-
-
-
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 viewuserName
- 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 annotateduserName
- 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 annotationsuserName
- 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 edituserName
- the name of the user to edit the annotationannotationId
- the id of the annotation to be edited- Returns:
true
if the user can edit the annotation,false
otherwise
-
-