Wikimedia Developer Support

API meta=userinfo shows different rights between ApiSandbox and OAuth

oauth
commons
api

#1

I’m sure I’m doing something daft, but I can’t figure it out…

I’m making the same API call on Commons of meta=userinfo&uiprop=rights|groups via

The groups returned by both is the same, but the rights are not.

Specifically, I’m trying to set a file’s caption with 'action=wbsetlabel&language=en&id=M123&value=Blah etc. but am getting:

You do not have the permissions needed to carry out this action.
The action you have requested is limited to users in the group: *.

Even though * is definitely listed in my groups (in API calls from either place).

Can someone tell me what I’m doing wrong?


#2

That is T218674.


#3

Ah great! I mean, not great, but I’m glad I’m not doing it wrong. :slight_smile:

Thanks.


#4

Actually, is it possible that this is the bug I’m running into, and the error message is misleading? https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikibaseMediaInfo/+/510946


#5

Yep, that was the issue. I guess the error message could be improved (i.e. make it more clear that it’s not a group membership that’s lacking, but rather a grant provision). I’ll try to make a patch.


#6

The permission system doesn’t know whether a permission or a grant is lacking (which is certainly not great but not trivial to fix - filed T227975). The easier bug is that the message should say what action the permission is missing for. Normally that would happen via permissionserrorstext-withaction, but this seems to be a different text, which codesearch can’t find (maybe it has been changed since then?).