With scripts it is possible to check whether you have sysop rights, for example.
if (mw.config.get('wgUserGroups').includes('global-sysop'))
This also works for global groups.
However, this is not always helpful for global sysops and other non-global global groups, as the wikiset must also be checked.
Example the wgGlobalGroups is always. But global-sysop is only in small wikis active.
wgGlobalGroups":["abusefilter-helper","global-ipblock-exempt","global-rollbacker","global-sysop"]
It would be good if you could add a variable with the name "ActiveGlobalGroups" or "RelevantGlobalGroups".
This would have the advantage of making scripts shorter and simpler, and would also reduce the number of API requests that user scripts make in the background.