Module:Effective protection level/doc
This is the documentation page for Module:Effective protection level
{{#if:protected|{{#switch:m |m
|t =
{{#switch: protected
| pre-alpha | prealpha | pa | experimental = File:Ambox warning blue construction.svg | alpha | a = File:Greek lc alpha icon.svg | beta | b = File:Greek lc beta icon.svg | release | r | general | g | stable | protected | protect | p | semiprotected | semiprotect | semi = File:Green check.svg | broken | br | unstable = File:Red x.svg | deprecated | d | defunct = File:Historical.svg}} | {{#switch: protected
| pre-alpha | prealpha | pa | experimental = This module is rated as pre-alpha. It is incomplete and may or may not be in active development. Do not use it in article namespace pages. A module remains in pre-alpha until its developer, or another editor who adopts it if it is abandoned for some time, considers the basic structure complete. | alpha | a = This module is rated as alpha. It is ready for limited use and third-party feedback. It may be used on a small number of pages, but should be monitored closely. Suggestions for new features or adjustments to input and output are welcome. | beta | b = This module is rated as beta. It is considered ready for widespread use, but as it is still relatively new, it should be applied with some caution to ensure results are as expected. | release | r | general | g | stable | protected | protect | p | semiprotected | semiprotect | semi = This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. | broken | br | unstable = This module is rated as unstable. It has missing dependencies, compatibility issues, or output errors that make it unusable. Editors are encouraged to improve its compatibility or nominate it for deletion if it cannot be fixed. | deprecated | d | defunct = This module is rated as deprecated and defunct.{{#if:|{{#iferror:{{#expr:1}} |{{#switch:{{{1}}} |fig= |en= |em= |thin= |hair= | }} |{{#switch:{{{2}}} |fig= |en= |em= |thin= |hair= | }} }}It is recommended editors use [[{{{replaced}}}]].}}{{#if:|{{#iferror:{{#expr:1}} |{{#switch:{{{1}}}
|fig=
|en=
|em=
|thin=
|hair=
|
}}
|{{#switch:{{{2}}}
|fig=
|en=
|em=
|thin=
|hair=
|
}}
}}{{{message}}}}} | #default = Page using Template:Template rating with invalid template or module rating in
}} |
{{#if:||
{{#switch: doc
| doc | sandbox =
| {{#ifeq: | true
|
| {{#switch: protected
| pre-alpha | prealpha | pa | experimental =
| alpha | a =
| beta | b =
| release | r | general | g | stable | protected | p | semiprotected | semiprotect | semi =
| deprecated | d | defunct =
| broken | br | unstable =
}}
}}
}}
}} | #default = }}|}}{{#switch:m |t|m = {{#if:
|
|{{#switch:Lua error in Module:Effective_protection_level at line 64: attempt to index field 'ext' (a nil value).
|*|user =
|#default = {{#ifeq:doc|doc
|Lua error in Module:Effective_protection_level at line 64: attempt to index field 'ext' (a nil value).
-->|Lua error in Module:Effective_protection_level at line 64: attempt to index field 'ext' (a nil value).}}}}}}
|#default = }}
| File:Cascade-protection-shackle.svg | This module can only be edited by administrators because it is transcluded onto one or more cascade-protected pages. |
Lua error in Module:Effective_protection_level at line 64: attempt to index field 'ext' (a nil value).
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 a JavaScript or CSS subpage in userspace, or in the MediaWiki namespace: interfaceadmin
- The page being in the MediaWiki namespace: sysop
- The page being a JSON subpage in userspace: sysop
- The page being protected: sysop, templateeditor, extendedconfirmed, or autoconfirmed
- The page being used in a cascading-protected page: sysop
- The page's title matching the titleblacklist: templateeditor or autoconfirmed
- A file being moved: filemover
- A page being moved or a file being uploaded: autoconfirmed
- A non-Draft non-talk page being created: user
- Anything else: *
Note that if a template-protected file is moved, both filemover and templateeditor are required, but this will return only templateeditor. This is not likely to be changed any time soon, since template protection currently shouldn't be used on files.
Usage
Warning: This module will use up to 4 expensive parser function calls each time it is ran. It should only be used if the exact effective protection level is necessary. Otherwise, consider using title.protectionLevels instead.
From other modules
To load this module: <syntaxhighlight lang="lua"> 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", "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
The parameters are the same as when it is called directly.
{{#invoke:Effective protection level|action|title}}
See also
- Pages with script errors
- Pages with broken file links
- Pages using template rating template with unknown parameters
- Modules in pre-alpha development
- Modules in alpha
- Modules in beta
- Modules for general use
- Deprecated modules
- Unstable modules
- Pages with templates in the wrong namespace
- Module documentation pages