WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 8 months ago

#41037 new defect (bug)

Comment author can't edit their comment(s) if they aren't the post author

Reported by: henry.wright Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Comments Keywords: needs-patch
Focuses: Cc:

Description

In map_meta_cap(), the edit_comment meta capability is eventually mapped to edit_others_posts which results in comment authors not being able to edit their own comment(s) if their comment(s) are on a different user's post.

Note 1: The issue is specific to the author role. The editor role doesn't see the issue because this role has the edit_others_posts cap.

Note 2: The problem doesn't exist if the comment author is also the post author. This is because, in such cases, edit_comment is mapped to either edit_published_posts or edit_posts

Attachments (2)

41037.diff (2.6 KB) - added by lipathor 8 months ago.
41037.2.diff (2.6 KB) - added by lipathor 8 months ago.

Download all attachments as: .zip

Change History (6)

#1 @meloniq
15 months ago

  • Keywords needs-patch added

Related #47024

#2 @SergeyBiryukov
15 months ago

  • Component changed from General to Comments

#3 @lipathor
8 months ago

I think i resolved issue. Please for review.

@lipathor
8 months ago

@lipathor
8 months ago

#4 @lipathor
8 months ago

There where an error in first patch, use second one please.

Note: See TracTickets for help on using tickets.