Module:Effective protection level/doc: Difference between revisions
From Neodyland Wiki
More actions
No edit summary |
m 35 revisions imported |
||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{Module rating|protected}} | {{Module rating|protected}} | ||
{{high-use|37382}} | <!-- {{high-use|37382}} | ||
{{used in system}} | {{used in system}} --> | ||
This module provides a way to retrieve the group required to perform a given action on a page. It currently tests the following criteria: | This module provides a way to retrieve the group required to perform a given action on a page. It currently tests the following criteria: | ||
* The page being pending-changes protected: autoconfirmed | * The page being pending-changes protected: autoconfirmed | ||
* The page being a JavaScript or CSS subpage in userspace, or in the MediaWiki namespace: interfaceadmin | |||
* The page being in the MediaWiki namespace: sysop | * The page being in the MediaWiki namespace: sysop | ||
* The page being a JSON subpage in userspace: sysop | * The page being a JSON subpage in userspace: sysop | ||
* The page being protected: sysop, templateeditor, extendedconfirmed, or autoconfirmed | * The page being protected: sysop, templateeditor, extendedconfirmed, or autoconfirmed | ||
| Line 22: | Line 22: | ||
=== From other modules === | === From other modules === | ||
To load this module: | To load this module: | ||
< | <syntaxhighlight lang="lua"> | ||
local effectiveProtectionLevel = require('Module:Effective protection level')._main | local effectiveProtectionLevel = require('Module:Effective protection level')._main | ||
</ | </syntaxhighlight> | ||
The function accepts two parameters. The first is a string containing the action to check, which must be one of "edit", "create", "move", "upload", or "autoreview". The second is optional, and can either be the name of the page to check, or a title returned from the mw.title functions. If the second parameter is omitted, the page being displayed is the one checked against. The return value is a string containing the name of the group required to perform the given action. | The function accepts two parameters. The first is a string containing the action to check, which must be one of "edit", "create", "move", "upload", "undelete", or "autoreview". The second is optional, and can either be the name of the page to check, or a title returned from the mw.title functions. If the second parameter is omitted, the page being displayed is the one checked against. The return value is a string containing the name of the group required to perform the given action. | ||
=== From wikitext === | === From wikitext === | ||
The parameters are the same as when it is called directly. | The parameters are the same as when it is called directly. | ||
{{mlx|Effective protection level|''action''|''title''}} | |||
== See also == | == See also == | ||
* [[Module:Effective protection expiry]] | * [[Module:Effective protection expiry]] | ||