(Private activity, I just can’t be bothered to create a non-work account right now, sorry.)
I’m working on a tool to patrol recent changes, which includes making API calls to rollback some edits. Python snippet:
session = authenticated_session()
token = session.get(action='query',
meta='tokens',
type='rollback')['query']['tokens']['rollbacktoken']
results = session.get(action='query',
revids=[str(id)],
prop='revisions',
rvprop='user',
formatversion='2')
for page in results['query']['pages']:
pageid = page['pageid']
user = page['revisions'][0]['user']
break
session.post(action='rollback',
pageid=pageid,
user=user,
token=token)
However, I’m getting the following error:
mwapi.errors.APIError: permissiondenied: The action you have requested is limited to users in one of the groups: *, [[Wikidata:Users|Users]].
This doesn’t make any sense to me. The session I’m using to make this request is authenticated (I can verify this with a manual call to action=query&meta=userinfo
), and the user account has the rollback right (the tool explicitly verifies this with a call to action=query&meta=userinfo&uiprop=rights
). Furthermore, surely my account would be considered both a “user” and an “anything”, which I assume must be what the *
means?
I tried looking through the MediaWiki source, but couldn’t figure out where this error is being thrown. Does anyone have a clue what’s going on? (The wiki is Wikidata, if it matters, and specifically I’m testing with revision 820157734.)