Module:Effective protection level/doc
Ceci est la page de documentation pour Module:Effective protection level
{{#ifeq:doc|doc|{{#if:|Erreur de script : le module « Fix » n’existe pas.{{#ifeq:Module || {{#if: | [[Catégorie:]]}} }}}}|{{#switch:
{{#if:
|
| {{#ifeq:Module|Module
| module
| other
}}
}}
| module =
{{#switch: protected
| pre-alpha | prealpha | pa | experimental = Pre-alpha | alpha | a = Alpha | beta | b = Beta | release | r | general | g | stable | protected | protect | p | semiprotected | semiprotect | semi = Ready for use | broken | br | unstable = Unstable}} | {{#switch: protected
| pre-alpha | prealpha | pa | experimental = This module is rated as pre-alpha. It is unfinished, and may or may not be in active development. It should not be used from article namespace pages. Modules remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure. | alpha | a = This module is rated as alpha. It is ready for third-party input, and may be used on a few pages to see if problems arise, but should be watched. Suggestions for new features or changes in their input and output mechanisms are welcome. | beta | b = This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the 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 form and is thought to be relatively bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn. To reduce server load and bad output, it should be improved by sandbox testing rather than repeated trial-and-error editing. | broken | br | unstable = This module is rated as unstable. It contains either missing dependencies, compatibility errors, or output errors that make it unusable. Please help improve compatibility of this module, or nominate this module for deletion if it is unfixable. | #default = <{{#switch: |div=div|p=p|span=span|#default=strong }} class="error">Module rating is invalid or not specified.</{{#switch: |div=div|p=p|span=span|#default=strong }}> }} |
{{#if:||
{{#ifeq: Module:Effective protection level/doc | Sandbox
|
| {{#switch: doc
| doc | sandbox =
| {{#ifeq: | true
|
| {{#switch: protected
| pre-alpha | prealpha | pa | experimental =
| alpha | a =
| beta | b =
| release | r | general | g | stable =
| broken | br | unstable =
}}
}}
}}
}}
}}{{#switch: |t
|m = {{#switch:Erreur Lua dans Module:Effective_protection_level à la ligne 14 : attempt to index local 'title' (a nil value).|*|user=|#default=
| [[File:{{#switch:Erreur Lua dans Module:Effective_protection_level à la ligne 14 : attempt to index local 'title' (a nil value).|autoconfirmed=Semi|extendedconfirmed=Extended|accountcreator|templateeditor=Template|sysop=Full}}-protection-shackle.svg|40x40px|link=|alt=Protected]] | This is subject to page protection{{#if:|{{#if:
| String Module Error: function rep expects a number as second parameter, received "" |}}|. It is a highly visible in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing.}} |
{{#if:{{#if:||demopage=}}||
{{#ifeq: Effective protection level | Sandbox
|
| {{#switch: doc
| doc | sandbox =
| {{#ifeq: false | true
|
| {{#switch:
{{#if:
| {{{demospace}}}
| {{#ifeq:Module|Module
| module
| other
}}
}}
| module = | other | #default = }}
}}
}}
}}
}} }} |#default= }} | other | #default = <{{#switch: |div=div|p=p|span=span|#default=strong }} class="error">Error: {{Module rating}} must be placed in the Module namespace.</{{#switch: |div=div|p=p|span=span|#default=strong }}> }}}}
| Fichier:Cascade-protection-shackle.svg | This module can only be edited by administrators because it is transcluded onto one or more cascade-protected pages. |
| Warning | This Lua module is used {{#if:|{{{1}}}|in system messages}}, and on approximately 68 000 pages. Changes to it can cause immediate changes to the Wikipedia user interface. To avoid major disruption, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them. |
{{#if:{{#ifeq:doc|sandbox|1}}{{#ifeq:doc|doc|1}}||{{#switch:Erreur Lua : First parameter must be one of edit, move, create, upload, undelete, autoreview.|sysop|templateeditor|interfaceadmin=|#default=}}}}
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 avec des erreurs de script
- Pages avec des liens de fichiers brisés
- Modules in pre-alpha development
- Modules in alpha
- Modules in beta
- Modules for general use
- Unstable modules
- Errors reported by Module String
- Modules subject to page protection
- Pages with templates in the wrong namespace
- Pages used in system messages needing protection
- Module documentation pages