Page MenuHomePhabricator

User groups should be exposed to Scribunto
Open, LowPublic

Description

Scribunto should have an interface to get the groups a user is in. Example:

if mw.user.new(frame.args[1]).groups.sysop then
 return 'Admin'
else
 return 'User'
end

This was requested on https://en.wikipedia.org/w/index.php?oldid=639931577#Simpler_process_for_submitting_a_request_for_arbitration

Event Timeline

Jackmcbarn updated the task description. (Show Details)
Jackmcbarn raised the priority of this task from to Low.
Jackmcbarn added a subscriber: Jackmcbarn.
Anomie added a subscriber: Anomie.Dec 29 2014, 1:51 AM

Note that any way to get the "current" user (or any data about the "current" user) would be a no-go, as it would break caching horribly. But access to publicly-accessibly data about a user (i.e. what's available from the API list=users) by name doesn't a priori seem like a problem.

gerritbot added a subscriber: gerritbot.

Change 188503 had a related patch set uploaded (by Jackmcbarn):
Expose user information to Lua

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

Patch-For-Review

Rical added a subscriber: Rical.Feb 5 2015, 8:54 AM
Rical added a comment.Feb 7 2015, 7:21 PM

A related bug ask also the user language code. An english admin could then better help any other little wiki.
https://phabricator.wikimedia.org/T68051
examples : https://fr.wikisource.org/wiki/Module:ControlArgs#Multilingual_examples._Exemples_multilingues

That's completely unrelated.

Rical renamed this task from User groups should be exposed to Scribunto to Expose users groups to modules to better adapt their displays to readers or supporters.May 21 2016, 12:18 PM
Rical updated the task description. (Show Details)
Jackmcbarn renamed this task from Expose users groups to modules to better adapt their displays to readers or supporters to User groups should be exposed to Scribunto.May 22 2016, 3:05 AM
Jackmcbarn updated the task description. (Show Details)

Rical, please don't do that.