Skip to content

don't offer edit reviews in categories where you can't approve #1908

@cellio

Description

@cellio

The page of pending suggested edits is viewable by anyone. If you don't have the Edit Posts ability, then you see a notice on that page, and if you visit a suggested edit, you see this notice: "You can't approve or reject suggested edits because you haven't yet earned the Edit ability" and the page does not include the review buttons. (Suggested edits are read-only.) Users with the Edit Posts ability can review and get the buttons to approve or reject. Good so far.

Categories can restrict who can post, and #1642 added some enforcement for edits too. Users who could normally edit instead have to submit suggested edits, and only people who can post can approve those edits. Also good.

However, a user with Edit Posts sees the approve/reject buttons, but trying to approve (or even reject) produces a red-popup error, and it's also a contextually-wrong error:

error message after rejecting an edit saying you need the Edit Posts ability

Can we check the category permissions and, if we'd reject the edit, treat it like for non-editor users, showing a message and not showing the buttons? The message would need to be different -- in this case the user has Edit Posts, but in this category that is not sufficient.

#1907 adds a helper method accessible_to?(user, category), so fixing this issue should be easier after that merges.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions