-
-
Notifications
You must be signed in to change notification settings - Fork 71
Description
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:
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.