class MediaWiktory::Wikipedia::Actions::Globaluserrights

Add/remove a user to/from global groups.

Usage:

“`ruby 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 {MediaWiktory::Wikipedia::Response} for working with action responses.

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

Public Instance Methods

_add(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/globaluserrights.rb, line 47
def _add(value)
  defined?(super) && super || ["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"].include?(value.to_s) && merge(add: value.to_s, replace: false)
end
_remove(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/globaluserrights.rb, line 60
def _remove(value)
  defined?(super) && super || ["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"].include?(value.to_s) && merge(remove: value.to_s, replace: false)
end
_tags(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/globaluserrights.rb, line 89
def _tags(value)
  defined?(super) && super || ["ProveIt edit", "WPCleaner", "huggle", "large plot addition"].include?(value.to_s) && merge(tags: value.to_s, replace: false)
end
add(*values) click to toggle source

Add the user to these global groups.

@param 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”. @return [self]

# 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) click to toggle source

Reason for the change.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/globaluserrights.rb, line 68
def reason(value)
  merge(reason: value.to_s)
end
remove(*values) click to toggle source

Remove the user from these global groups.

@param 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”. @return [self]

# 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) click to toggle source

This parameter is currently unused.

@param values [Array<String>] Allowed values: “ProveIt edit”, “WPCleaner”, “huggle”, “large plot addition”. @return [self]

# 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) click to toggle source

A “userrights” token retrieved from action=query&meta=tokens

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/globaluserrights.rb, line 76
def token(value)
  merge(token: value.to_s)
end
user(value) click to toggle source

Global user name.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/globaluserrights.rb, line 26
def user(value)
  merge(user: value.to_s)
end
userid(value) click to toggle source

Global user ID.

@param value [Integer] @return [self]

# File lib/mediawiktory/wikipedia/actions/globaluserrights.rb, line 34
def userid(value)
  merge(userid: value.to_s)
end