Class: MediaWiktory::Wikipedia::Actions::Globaluserrights

Inherits:
Post
  • Object
show all
Defined in:
lib/mediawiktory/wikipedia/actions/globaluserrights.rb

Overview

Add/remove a user to/from global groups.

Usage:

api.globaluserrights.user(value).perform # returns string with raw output
# or
api.globaluserrights.user(value).response # returns output parsed and wrapped into Response object

See Base for generic explanation of working with MediaWiki actions and Response for working with action responses.

All action's parameters are documented as its public methods, see below.

Instance Method Summary collapse

Methods inherited from Post

#perform

Methods inherited from Base

#inspect, #merge, #name, #perform, #response, #to_h, #to_param, #to_url

Methods included from GlobalParams

#assert, #assertuser, #centralauthtoken, #curtimestamp, #errorformat, #errorlang, #errorsuselocal, #format, #maxage, #maxlag, #origin, #requestid, #responselanginfo, #servedby, #smaxage, #uselang

Instance Method Details

#add(*values) ⇒ self

Add the user to these global groups.

Parameters:

  • values (Array<String>)

    Allowed values: "OTRS-member", "abusefilter-helper", "apihighlimits-requestor", "captcha-exempt", "delete-global", "founder", "global-bot", "global-flow-create", "global-interface-editor", "global-ipblock-exempt", "global-rollbacker", "global-sysop", "new-wikis-importer", "oathauth-tester", "ombudsman", "recursive-export", "staff", "steward", "sysadmin", "wmf-ops-monitoring", "wmf-researcher".

Returns:

  • (self)


42
43
44
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 42

def add(*values)
  values.inject(self) { |res, val| res._add(val) or fail ArgumentError, "Unknown value for add: #{val}" }
end

#reason(value) ⇒ self

Reason for the change.

Parameters:

  • value (String)

Returns:

  • (self)


68
69
70
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 68

def reason(value)
  merge(reason: value.to_s)
end

#remove(*values) ⇒ self

Remove the user from these global groups.

Parameters:

  • values (Array<String>)

    Allowed values: "OTRS-member", "abusefilter-helper", "apihighlimits-requestor", "captcha-exempt", "delete-global", "founder", "global-bot", "global-flow-create", "global-interface-editor", "global-ipblock-exempt", "global-rollbacker", "global-sysop", "new-wikis-importer", "oathauth-tester", "ombudsman", "recursive-export", "staff", "steward", "sysadmin", "wmf-ops-monitoring", "wmf-researcher".

Returns:

  • (self)


55
56
57
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 55

def remove(*values)
  values.inject(self) { |res, val| res._remove(val) or fail ArgumentError, "Unknown value for remove: #{val}" }
end

#tags(*values) ⇒ self

This parameter is currently unused.

Parameters:

  • values (Array<String>)

    Allowed values: "ProveIt edit", "WPCleaner", "huggle", "large plot addition".

Returns:

  • (self)


84
85
86
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 84

def tags(*values)
  values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, "Unknown value for tags: #{val}" }
end

#token(value) ⇒ self

A "userrights" token retrieved from action=query&meta=tokens

Parameters:

  • value (String)

Returns:

  • (self)


76
77
78
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 76

def token(value)
  merge(token: value.to_s)
end

#user(value) ⇒ self

Global user name.

Parameters:

  • value (String)

Returns:

  • (self)


26
27
28
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 26

def user(value)
  merge(user: value.to_s)
end

#userid(value) ⇒ self

Global user ID.

Parameters:

  • value (Integer)

Returns:

  • (self)


34
35
36
# File 'lib/mediawiktory/wikipedia/actions/globaluserrights.rb', line 34

def userid(value)
  merge(userid: value.to_s)
end