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

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T14576, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12576 - Move page doesn't use "userCan" hook
Move page doesn't use "userCan" hook
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.10.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  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: ---


Attachments

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.


Navigation
Links