Page MenuHomePhabricator

Expose User::isSystemUser in the Action API
Closed, ResolvedPublicFeature

Event Timeline

JJMC89 added subscribers: DannyS712, JJMC89.

@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

https://gerrit.wikimedia.org/r/848099

OwenRB triaged this task as Lowest priority.

@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.

It adds a "systemuser": true property to the API response, for system users only (non-system users do not get "systemuser": false):

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

https://gerrit.wikimedia.org/r/848099

JJMC89 removed a project: Patch-For-Review.

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)