Last modified: 2010-05-15 15:50:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 12576 - Move page doesn't use "userCan" hook
Move page doesn't use "userCan" hook
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2008-01-10 13:46 UTC by Markus Kappe
Modified: 2010-05-15 15:50 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Markus Kappe 2008-01-10 13:46:07 UTC
When I try to move a page, the rights are checked with the function $wgUser->isAllowed('move'). (includes/SpecialMovepage.php:wfSpecialMovepage). This function doesn't make use of the userCan hook. This makes it impossible to write an extension without core patch to handle user rights.

Maybe I do something wrong and should use another hook to fill $wgUser->mRights prior to that call of isAllowed? Got some advice?

See also bug #10758 for other request regarding the call of isAllowed. Both issues could be solved at a time.
Comment 1 Roan Kattouw 2008-01-10 13:53:32 UTC
This is (more or less) intended behavior: Special:Movepage only shows up if you have move rights (hence checking $wgUser->isAllowed('move')), but the function that *does* the actual move (Title::moveTo()) uses $title->userCan('move'), so you can hook in there just fine. I guess the reason behind this (if any) is that you can load Special:Movepage and then change the page name in the form.
Comment 2 Markus Kappe 2008-01-10 14:38:24 UTC
First of all thanx for the quick answer!

So is it right, that I cannot define $wgGroupPermissions['*' ]['move'] = false; in LocalSettings BUT allow it afterwards depending on my own custom function (because the hook that calls the function can never be called)?
Comment 3 Roan Kattouw 2008-01-10 14:46:01 UTC
That's right. In this case, you should do it the other way around: set $wgGroupPermissions['*']['move'] = true; and have your hook return false (and set $result=false) when the move shouldn't be allowed.

Note You need to log in before you can comment on or make changes to this bug.