Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-21730: Delete own comments should not require edit rights on page #2836

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ $xwiki.ssfx.use('uicomponents/viewers/comments.css', true)
<a class="permalink btn btn-default btn-xs" data-toggle="modal" data-target="#permalinkModal" rel="nofollow"
href="$doc.getURL('view', 'viewer=comments')#xwikicomment_${comment.number}"
title="$services.localization.render('core.viewers.comments.permalink')">$services.icon.renderHTML('link')</a>
#if ($hasAdmin || ($hasEdit && $isUserComment))
#if ($hasAdmin || ($xwiki.hasAccessLevel('comment') && $isUserComment))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent I would reuse the same condition than the one used for editing a comment, which is right now #if($hasAdmin || $isUserComment) (see line 180).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in f536a96 and f943ae6 . 👍

This selector was a bit more restrictive, actually checking for the comment right. Now, any user can delete their comments even if they don't have any right on a page.

## If a remote URL is provided, content will be loaded into .modal-content because of bootstrap.
## By providing an anchor this behavior is stoped, without altering the URL functionality.
#set ($queryString = $escapetool.url({
Expand Down