Last modified: 2009-04-08 21:00:11 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 T20395, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18395 - Augment (or replace) wgNonincludableNamespaces with userCan
Augment (or replace) wgNonincludableNamespaces with userCan
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Page protection (Other open bugs)
1.14.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-07 23:07 UTC by Volodymyr
Modified: 2009-04-08 21:00 UTC (History)
2 users (show)

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


Attachments

Description Volodymyr 2009-04-07 23:07:09 UTC
(This would be nice to have, but probably not going to happen)

in includes/parser/Parser.php

Force the use of userCan() hook for templates ($wgNonincludableNamespaces is used now):

 else if ( $wgNonincludableNamespaces && in_array( $title->getNamespace(), $wgNonincludableNamespaces ) ) {

becomes

 else if ( !$title->userCanRead() || $wgNonincludableNamespaces && in_array( $title->getNamespace(), $wgNonincludableNamespaces ) ) {
Comment 1 Roan Kattouw 2009-04-08 09:55:37 UTC
Note that *replacing* $wgNonincludableNamespaces with a userCanRead() check is not desirable, since that would eliminate the distinction between the ability to _read_ a template and _include_ it.
Comment 2 Volodymyr 2009-04-08 14:41:49 UTC
Sure, (though its not clear to me why the need to split _read_ and _include_ permissions, it must be useful) the idea is still the same: replace $wgNonincludableNamespaces with a function call (which calls userCan hook). One could reuse $title->userCan('include'). I know the code suggested above works, but I haven't run any performance metrics on it. Bottom line, for me, I would like to see OOriented fix to the permissions all through the code, through userCan hook.
Comment 3 Chad H. 2009-04-08 21:00:11 UTC
Marking as INVALID. You're mixing userCan (which deals with rights) with a per-namespace config setting (which isn't related to user rights at all).

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


Navigation
Links