MediaWiki  master
MWGrants.php
Go to the documentation of this file.
1 <?php
22 
28 class MWGrants {
29 
35  public static function getValidGrants() {
36  return MediaWikiServices::getInstance()->getGrantsInfo()->getValidGrants();
37  }
38 
44  public static function getRightsByGrant() {
45  return MediaWikiServices::getInstance()->getGrantsInfo()->getRightsByGrant();
46  }
47 
55  public static function grantName( $grant, $lang = null ) {
56  return MediaWikiServices::getInstance()->getGrantsLocalization()->getGrantDescription( $grant, $lang );
57  }
58 
66  public static function grantNames( array $grants, $lang = null ) {
67  return MediaWikiServices::getInstance()->getGrantsLocalization()->getGrantDescriptions( $grants, $lang );
68  }
69 
76  public static function getGrantRights( $grants ) {
77  return MediaWikiServices::getInstance()->getGrantsInfo()->getGrantRights( $grants );
78  }
79 
86  public static function grantsAreValid( array $grants ) {
87  return MediaWikiServices::getInstance()->getGrantsInfo()->grantsAreValid( $grants );
88  }
89 
96  public static function getGrantGroups( $grantsFilter = null ) {
97  return MediaWikiServices::getInstance()->getGrantsInfo()->getGrantGroups( $grantsFilter );
98  }
99 
105  public static function getHiddenGrants() {
106  return MediaWikiServices::getInstance()->getGrantsInfo()->getHiddenGrants();
107  }
108 
121  public static function getGrantsLink( $grant, $lang = null ) {
122  return MediaWikiServices::getInstance()->getGrantsLocalization()->getGrantsLink( $grant, $lang );
123  }
124 
133  public static function getGrantsWikiText( $grantsFilter, $lang = null ) {
134  return MediaWikiServices::getInstance()->getGrantsLocalization()->getGrantsWikiText( $grantsFilter, $lang );
135  }
136 
137 }
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:193
$lang
if(!isset( $args[0])) $lang
Definition: testCompression.php:37
MWGrants\getGrantRights
static getGrantRights( $grants)
Fetch the rights allowed by a set of grants.
Definition: MWGrants.php:76
MWGrants\grantNames
static grantNames(array $grants, $lang=null)
Fetch the descriptions for the grants.
Definition: MWGrants.php:66
MWGrants\getHiddenGrants
static getHiddenGrants()
Get the list of grants that are hidden and should always be granted.
Definition: MWGrants.php:105
MWGrants\getGrantsLink
static getGrantsLink( $grant, $lang=null)
Generate a link to Special:ListGrants for a particular grant name.
Definition: MWGrants.php:121
MWGrants\getGrantsWikiText
static getGrantsWikiText( $grantsFilter, $lang=null)
Generate wikitext to display a list of grants.
Definition: MWGrants.php:133
MWGrants\grantName
static grantName( $grant, $lang=null)
Fetch the description of the grant.
Definition: MWGrants.php:55
MWGrants\getValidGrants
static getValidGrants()
List all known grants.
Definition: MWGrants.php:35
MWGrants\grantsAreValid
static grantsAreValid(array $grants)
Test that all grants in the list are known.
Definition: MWGrants.php:86
MWGrants\getGrantGroups
static getGrantGroups( $grantsFilter=null)
Divide the grants into groups.
Definition: MWGrants.php:96
MWGrants
Definition: MWGrants.php:28
MWGrants\getRightsByGrant
static getRightsByGrant()
Map all grants to corresponding user rights.
Definition: MWGrants.php:44