MediaWiki  master
MWGrants Class Reference

Static Public Member Functions

static getGrantGroups ( $grantsFilter=null)
 Divide the grants into groups. More...
 
static getGrantRights ( $grants)
 Fetch the rights allowed by a set of grants. More...
 
static getGrantsLink ( $grant, $lang=null)
 Generate a link to Special:ListGrants for a particular grant name. More...
 
static getGrantsWikiText ( $grantsFilter, $lang=null)
 Generate wikitext to display a list of grants. More...
 
static getHiddenGrants ()
 Get the list of grants that are hidden and should always be granted. More...
 
static getRightsByGrant ()
 Map all grants to corresponding user rights. More...
 
static getValidGrants ()
 List all known grants. More...
 
static grantName ( $grant, $lang=null)
 Fetch the description of the grant. More...
 
static grantNames (array $grants, $lang=null)
 Fetch the descriptions for the grants. More...
 
static grantsAreValid (array $grants)
 Test that all grants in the list are known. More...
 

Detailed Description

Deprecated:
since 1.38, use GrantsInfo and GrantsLocalization instead

A collection of public static functions to deal with grants.

Definition at line 28 of file MWGrants.php.

Member Function Documentation

◆ getGrantGroups()

static MWGrants::getGrantGroups (   $grantsFilter = null)
static

Divide the grants into groups.

Deprecated:
since 1.38, use GrantsInfo::getGrantGroups() instead
Parameters
string[] | null$grantsFilter
Returns
array Map of (group => (grant list))

Definition at line 96 of file MWGrants.php.

◆ getGrantRights()

static MWGrants::getGrantRights (   $grants)
static

Fetch the rights allowed by a set of grants.

Deprecated:
since 1.38, use GrantsInfo::getGrantRights() instead
Parameters
string[] | string$grants
Returns
string[]

Definition at line 76 of file MWGrants.php.

Referenced by MediaWiki\Session\Session\BotPasswordSessionProvider\newSessionForRequest(), and MediaWiki\Session\Session\BotPasswordSessionProvider\refreshSessionInfo().

◆ getGrantsLink()

static MWGrants::getGrantsLink (   $grant,
  $lang = null 
)
static

Generate a link to Special:ListGrants for a particular grant name.

This should be used to link end users to a full description of what rights they are giving when they authorize a grant.

Deprecated:
since 1.38, use GrantsLocalization::getGrantsLink() instead
Parameters
string$grantthe grant name
Language | string | null$lang
Returns
string (proto-relative) HTML link

Definition at line 121 of file MWGrants.php.

References $lang.

◆ getGrantsWikiText()

static MWGrants::getGrantsWikiText (   $grantsFilter,
  $lang = null 
)
static

Generate wikitext to display a list of grants.

Deprecated:
since 1.38, use GrantsLocalization::getGrantsWikiText() instead
Parameters
string[] | null$grantsFilterIf non-null, only display these grants.
Language | string | null$lang
Returns
string Wikitext

Definition at line 133 of file MWGrants.php.

References $lang.

◆ getHiddenGrants()

static MWGrants::getHiddenGrants ( )
static

Get the list of grants that are hidden and should always be granted.

Deprecated:
since 1.38, use GrantsInfo::getHiddenGrants() instead
Returns
string[]

Definition at line 105 of file MWGrants.php.

Referenced by SpecialBotPasswords\getFormFields(), and SpecialBotPasswords\save().

◆ getRightsByGrant()

static MWGrants::getRightsByGrant ( )
static

Map all grants to corresponding user rights.

Deprecated:
since 1.38, use GrantsInfo::getRightsByGrant() instead
Returns
array grant => array of rights

Definition at line 44 of file MWGrants.php.

Referenced by SpecialBotPasswords\getFormFields().

◆ getValidGrants()

static MWGrants::getValidGrants ( )
static

List all known grants.

Deprecated:
since 1.38, use GrantsInfo::getValidGrants() instead
Returns
array

Definition at line 35 of file MWGrants.php.

Referenced by CreateBotPassword\execute(), SpecialBotPasswords\getFormFields(), and CreateBotPassword\showGrants().

◆ grantName()

static MWGrants::grantName (   $grant,
  $lang = null 
)
static

Fetch the description of the grant.

Deprecated:
since 1.38, use GrantsLocalization::getGrantDescription() instead
Parameters
string$grant
Language | string | null$lang
Returns
string Grant description

Definition at line 55 of file MWGrants.php.

References $lang.

Referenced by SpecialListGrants\execute().

◆ grantNames()

static MWGrants::grantNames ( array  $grants,
  $lang = null 
)
static

Fetch the descriptions for the grants.

Deprecated:
since 1.38, use GrantsLocalization::getGrantDescriptions() instead
Parameters
string[]$grants
Language | string | null$lang
Returns
string[] Corresponding grant descriptions

Definition at line 66 of file MWGrants.php.

References $lang.

◆ grantsAreValid()

static MWGrants::grantsAreValid ( array  $grants)
static

Test that all grants in the list are known.

Deprecated:
since 1.38, use GrantsInfo::grantsAreValid() instead
Parameters
string[]$grants
Returns
bool

Definition at line 86 of file MWGrants.php.


The documentation for this class was generated from the following file: