This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-30e11c41-7dee-4dda-ad26-ffc233fa7f08 XWIKI-24689 Open

Wrong javadoc on LikeRight: it does not imply Login and View rights

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-ea125eaf-a6d1-44ed-a7fd-841f100ea2c0 Eleni created this issue on 12/Aug/26 15:11
 
Summary: Wrong javadoc on LikeRight: it does not imply Login and View rights
Issue Type: cid:jira-generated-image-avatar-30e11c41-7dee-4dda-ad26-ffc233fa7f08 Bug
Affects Versions: 12.7
Assignee: Unassigned
Components: Like
Created: 12/Aug/26 15:11
Priority: cid:jira-generated-image-static-major-937abfe4-1904-4ba1-ac88-fa4d3339758e Major
Reporter: Eleni
Description:

The class javadoc of org.xwiki.like.internal.LikeRight states:

This right is allowed by default and implies Login and View rights.

but getImpliedRights() returns null, so the like right implies no other right.

The javadoc was accurate when the class was added (XWIKI-17508), where getImpliedRights() returned LOGIN and VIEW leaked read access – but the javadoc was not updated, so it has described the opposite of the code ever since.

getDefaultState() does return RuleState.ALLOW, so "allowed by default" is correct. The javadoc could also mention that the right targets wiki, space and document entities (getTargetedEntityType() returns Right.XWIKI_SPACE_DOCUMENT).