Jump to content
Toggle menu
  • 3 articles
  • 75 files
  • 7 users
  • 37.9K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Effective protection level/doc: Difference between revisions

From Neodyland Wiki
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 JavaScript or CSS subpage in userspace: interfaceadmin
* 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:
<source lang="lua">
<syntaxhighlight lang="lua">
local effectiveProtectionLevel = require('Module:Effective protection level')._main
local effectiveProtectionLevel = require('Module:Effective protection level')._main
</source>
</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.
{{tlinv|Effective protection level|''action''|''title''}}
 
{{mlx|Effective protection level|''action''|''title''}}


== See also ==
== See also ==
* [[Module:Effective protection expiry]]
* [[Module:Effective protection expiry]]
Cookies help us deliver our services. By using our services, you agree to our use of cookies.