- As a bot operator
- When I fetch user information for a given user
- I should be able to see that the user is a system user
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Add systemuser param to Users API List result to flag system user accounts | mediawiki/core | master | +4 -0 |
Related Objects
Event Timeline
@DannyS712: Since you worked on the related tasks, any chance you would be interested in implementing this?
Change 848099 had a related patch set uploaded (by OwenR; author: OwenR):
[mediawiki/core@master] Add systemuser param to Users API List result to flag system user accounts
@JJMC89 asked me to take a look at the patch. It adds a "systemuser": true property to the API response, for system users only (non-system users do not get "systemuser": false):
{ "batchcomplete": true, "query": { "users": [ { "userid": 47, "name": "Maintenance script", "systemuser": true }, { "userid": 1, "name": "Matma Rex" } ] } }
I wondered if there's some convention we should follow here, but I couldn't find one. I thought that maybe it could be represented as an implicit user group, like temp users, but I see that T212720 was decided against that. I guess this way is fine, it's a small and harmless addition.
Thanks for taking a look. I found https://www.mediawiki.org/wiki/API:JSON_version_2#cite_note-1 about omitting a parameter when it is almost always false. Personally, I think it would be fine either way.
Change #848099 merged by jenkins-bot:
[mediawiki/core@master] Add systemuser param to Users API List result to flag system user accounts
Technically only format=json with formatversion=2 can return false properties, but in that case it must be set unconditional in the code (see for example 96b60ded7781080a47e7750a76b2d4a644751e21)