Last modified: 2010-05-15 15:50:56 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.
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.
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)?
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.