Author: bugzilla
Description:
The proposed enhancement:
- does not disrupt the stock MediaWiki
- allows for extensions to handle rights management at a more granular level.
Proposed change to User.php:
<source lang=php>
function isAllowed($action='', $ns = null /*optional*/, $title = null /* optional */ )
{ if ( $action === '' ) // In the spirit of DWIM return true; // CHANGE begin{{ $result = null; wfRunHooks('UserIsAllowed', array( &$this, $ns, $title, &$action, &$result ) ); if ( $result !== null ) return $result; // CHANGE end }} return in_array( $action, $this->getRights() ); }
</source>
Of course it does not address the policing issues of the whole MediaWiki platform but updating this method could open up the path to enhancements to the rights management sub-system i.e. do it piece-by-piece maybe? I know I have seen discussion around 'using more' the 'Title::userCan' method but, in retrospect, after delving for many hours in the bowels of MW, I now could argue 'more intelligently' that this wouldn't be, IMO, a course of action I would follow; e.g. there are 'title/namespace' level rights and there are 'title independent' rights to manage here.
Version: 1.11.x
Severity: enhancement