Page MenuHomePhabricator

EditRightConstraint checking "edit" rights in general instead of for specific page makes it difficult to customize permissions
Closed, ResolvedPublicBUG REPORT

Description

EditRightsConstraints does the check $this->performer->isAllowed( 'edit' ) which checks if the user has the ability to edit pages in general and not just this specific one. I think this check is too restrictive. It means that if someone writes an extension hooking into userCan to give edit rights for a specific page but not all pages, this won't work. I don't see any benefit to making the check this restrictive.

Looking in git blame, it seems like the check in question was originally added by RobLa in 2005 when the notion of "edit" rights was first created (a2a28a34c1fc / T2996). Presumably that was before we had per-page rights like we do now.

I propose adding the title to the check.

Event Timeline

Change 940632 had a related patch set uploaded (by Brian Wolff; author: Brian Wolff):

[mediawiki/core@master] Change EditPage 'edit' rights check to do per page instead of general

https://gerrit.wikimedia.org/r/940632

Change 962130 had a related patch set uploaded (by Pastakhov; author: Brian Wolff):

[mediawiki/core@master] Change EditPage 'edit' rights check to do per page instead of general

https://gerrit.wikimedia.org/r/962130

Change 940632 abandoned by Brian Wolff:

[mediawiki/core@master] Change EditPage 'edit' rights check to do per page instead of general

Reason:

abandoning in favour of https://gerrit.wikimedia.org/r/c/mediawiki/core/+/962130

https://gerrit.wikimedia.org/r/940632

Change 962130 merged by jenkins-bot:

[mediawiki/core@master] Change EditPage 'edit' rights check to do per page instead of general

https://gerrit.wikimedia.org/r/962130

matmarex assigned this task to Pastakhov.
matmarex subscribed.