MediaWiki API 帮助
这是一个自动生成的 MediaWiki API 文档页面。
文档和示例: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page
action=globaluserrights
( | globaluserrights)
- 此模块需要读取权限。
- 此模块需要写入权限。
- 此模块仅接受 POST 请求。
- 来源: CentralAuth
- 许可:
将用户添加到/从中移除全局组。
特定参数
其他通用参数可用。
- user
全局用户名。
- 类型:用户,按用户名和用户ID(例如,“#12345”)中的任何一个。
- userid
- 已弃用。
全局用户ID。
- 类型:integer
- add
将用户添加到这些全局组。
- 值(用 | 或 其他方式 分隔):abusefilter-helper, abusefilter-maintainer, apihighlimits-requestor, captcha-exempt, founder, global-bot, global-deleter, global-flow-create, global-interface-editor, global-ipblock-exempt, global-rollbacker, global-sysop, global-temporary-account-viewer, new-wikis-importer, oathauth-tester, ombuds, recursive-export, staff, steward, sysadmin, u4c-member, vrt-permissions, wmf-email-block-override, wmf-researcher
- expiry
过期时间戳。可以是相对时间(例如 5 months 或 2 weeks)或绝对时间(例如 2014-09-18T12:34:56Z)。如果只设置了一个时间戳,它将用于传递给 add 参数的所有组。使用 infinite、indefinite、infinity 或 never 表示永不过期用户组。
- 用 | 或 其他方式分隔值。
- 最多值数量为 50(对于允许更高限制的客户端为 500)。
- 默认值:infinite
- remove
从这些全局组中移除用户。
- 值(用 | 或 其他方式 分隔):abusefilter-helper, abusefilter-maintainer, apihighlimits-requestor, captcha-exempt, founder, global-bot, global-deleter, global-flow-create, global-interface-editor, global-ipblock-exempt, global-rollbacker, global-sysop, global-temporary-account-viewer, new-wikis-importer, oathauth-tester, ombuds, recursive-export, staff, steward, sysadmin, u4c-member, vrt-permissions, wmf-email-block-override, wmf-researcher
- reason
更改原因。
- 默认值:(空)
- token
从action=query&meta=tokens获取的“userrights”令牌。
为了兼容性,也接受 Web UI 中使用的令牌。
- 此参数是必需的。
此参数目前未使用。
- 值(用 | 或 备用选项 分隔)
示例
- 将用户FooBot添加到全局组“bot”,并从全局组“sysop”和“bureaucrat”中移除
- api.php?action=userrights&user=FooBot&add=bot&remove=sysop|bureaucrat&token=123ABC
- 将ID为123的全局用户添加到全局组“bot”,并从全局组“sysop”和“bureaucrat”中移除
- api.php?action=userrights&userid=123&add=bot&remove=sysop|bureaucrat&token=123ABC