Jump to content

Module:Effective protection level/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jackmcbarn (talk | contribs) at 19:00, 12 January 2014 (Created page with '{{module ranking|alpha}} This module provides a way to retrieve the permissions required to perform a given action on a page. It currently tests the following c...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Template:Module ranking

This module provides a way to retrieve the permissions required to perform a given action on a page. It currently tests the following criteria:

  • The page being in the MediaWiki namespace
  • The page being a userspace .js or .css
  • The page being protected

The following criteria are currently not testable, due to lack of support in MediaWiki:

  • The page being used in a cascading-protected page
  • The page's title matching the titleblacklist
  • The page having Pending Changes enabled

Usage

From other modules

To load this module:

local effectiveProtectionLevel = require('Module:Effective protection level').main

The function accepts two parameters. The first is a string containing the action to check, which must be one of "edit", "create", "move", or "upload". 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

Template:Effective protection level provides a wrapper around this module, allowing it to be used from wikitext. The parameters are the same as when it is called directly.

{{Effective protection level|action|title}}
{{Effective protection level|action=action|title=title}}