autopatrol
3,554
edits
mNo edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
// -------------------------------------------------------- | |||
// Rights | |||
// Sets a variable "rights" which will return "false" if the | |||
// currently logged in user is a bureaucrat, administrator, or autoconfirmed user. It will return true otherwise. | |||
// it also defines variables which may be used elsewhere in scripts. | |||
// -------------------------------------------------------- | |||
if (wgUserGroups){ | |||
var rights_isAuto = (wgUserGroups.toString().indexOf('autoconfirmed') != -1); | |||
var rights_isPatrol = (wgUserGroups.toString().indexOf('patroller') != -1); | |||
var rights_isAdmin = (wgUserGroups.toString().indexOf('sysop') != -1); | |||
var rights = true; | |||
} | |||
else { | |||
var rights = false; | |||
} | |||
// | |||
// -------------------------------------------------------- | // -------------------------------------------------------- |