Thanks Dmitriy. By looking at the code of Title::userCanReed, I noticed the 'userCan' hook that appears to be here for that exact purpose.
http://www.mediawiki.org/wiki/Manual:Hooks/userCan I think I will use it with a custom extension to filter pages by title. I was wondering however if userCanRead() is called only for the viewed page - or for transcluded pages as well? And for redirects: is userCanRead used both for source and target? Best regards, Sylvain. Dmitriy Sintsov a écrit : > * Sylvain Leroux <[email protected]> [Sat, 23 Jan 2010 13:33:20 > +0100]: >> Hi, >> >> For a private wiki, I had the request to add groups of pages to the >> white-list. >> Contributors will regularly add (and possibly delete) pages in those >> groups. So >> manually editing $wgWhitelistRead appears to be a maintenance > nightmare. >> >> So, is there a way to add regexp or namespace (or any other >> "collection" of >> pages) in $wgWhitelistRead? >> >> If not (as I think), is there a hook I could use to patch the > white-list >> validation? >> >> >> Thanks in advance for your answers, >> Sylvain Leroux >> >> > Before checking for title names in $wgWhitelistRead, includes/Title.php > calls $wgUser->isAllowed('read') , which itself calls User::getRights(), > which uses the hook 'UserGetRights': > http://www.mediawiki.org/wiki/Manual:Hooks/UserGetRights > which has the User object as a parameter, but unfortunately no Title > object passed, so you have to use global $wgTitle then additionally > check $wgTitle instanceof Title, I think. > Dmitriy > > _______________________________________________ > Wikitech-l mailing list > [email protected] > https://lists.wikimedia.org/mailman/listinfo/wikitech-l > > -- [email protected] http://www.chicoree.fr _______________________________________________ Wikitech-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikitech-l
