View source for User:Joepayne/stripRights.js
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
//Script to strip rights from a user on one click
//To do: add toggles for different skins
if( mw.config.get("wgRelevantUserName") ) {
var username = mw.config.get("wgRelevantUserName");
$.getJSON(
//Get user's group membership
mw.util.wikiScript('api'),
{
format: 'json',
action: 'query',
list: 'users',
usprop: 'groups',
ususers: username
}
).done( function ( data ) {
try {
if(data.query.users[0].groups.indexOf('!sysop') >= 0) {/* Do nothing */}
else {
var link = mw.util.addPortletLink(
'sidebar',
'#',
'Strip rights',
000
1:0
Return to User:Joepayne/stripRights.js.