User:BabylonAS/Sandbox/Matrix.js

// NickTheRed37’s Matrix sandbox

// Output rights of an user (or multiple, provided they are separated by pipe |) var listUserRights = function (userArg) { mw.loader.using(['mediawiki.api'], function {        new mw.Api.get({ action: 'query', list: 'users', ususers: userArg, usprop: 'rights' }).done(function (data) { var users = data.query.users; $.each(users, function {                var rightsList = '', rights = this.rights;                $.each(rights, function (id) { rightsList += this; if (id < rights.length-1) { rightsList += ', '; }               });                console.log(this.name + ': [' + rightsList + ']');            }); });   }); };