[Fusionforge-general] Interfacing with the MediaWiki API ?

Christian Bayle gforge at free.fr
Fri Mar 14 19:20:57 CET 2014


On 14/03/2014 17:24, Olivier Berger wrote:
> Olivier Berger <olivier.berger at telecom-sudparis.eu> writes:
>
>> Olivier Berger <olivier.berger at telecom-sudparis.eu> writes:
>>
>>> AFAICT, this works well, and the login succeeds :-)
>>>
>> Hmm... but it doesn't go any further :-/
>>
>> The login 2 steps are performing OK, and it seems the cookies are set,
>> but then, the next query fails :
>> api.php?action=query&meta=siteinfo&maxlag=120&siprop=general%7Cnamespaces%7Cnamespacealiases&format=json
>> gets :
>> readapidenied, You need read permission to use this module
>>
> My understanding is that even though the user seems to be logged in
> correctly via the action=login API invocation, and thus the MW cookies
> set, this next action=query won't work, unless the wiki is configured in
> fusionforge roles, so that anonymous users can read it...
The permission are also trapped with overloading a mw hook
Look at
https://fusionforge.org/plugins/mediawiki/wiki/fusionforge/index.php/Special:ListGroupRights
Perm are handled by
SetupPermissionsFromRoles and FusionForgeRoleToMediawikiGroupName
in src/plugins/mediawiki/www/LocalSettings.php
> So, it looks like the api doesn't detect the logged-in user for the read
> permissions... Maybe it expects all wikis to be publicly readable, or
> there is a bug...
>
> I'll have to dig the mediawiki api code, I guess.
>
> Any suggestions welcome, in the meantime.
>
> Best regards,
regards,

Christian



More information about the Fusionforge-general mailing list