46 $res[$grant] = array_keys( array_filter( $rights ) );
70 $msg->inLanguage(
$lang );
73 if ( !$msg->exists() ) {
91 foreach ( $grants as $grant ) {
106 foreach ( (array)$grants as $grant ) {
108 $rights = array_merge( $rights, array_keys( array_filter(
$wgGrantPermissions[$grant] ) ) );
111 return array_unique( $rights );
120 return array_diff( $grants, self::getValidGrants() ) === [];
131 if ( is_array( $grantsFilter ) ) {
132 $grantsFilter = array_fill_keys( $grantsFilter,
true );
137 if ( $grantsFilter !==
null && !isset( $grantsFilter[$grant] ) ) {
143 $groups[
'other'][] = $grant;
159 if ( $group ===
'hidden' ) {
177 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
178 return $linkRenderer->makeKnownLink(
180 self::grantName( $grant,
$lang )
191 if ( is_string(
$lang ) ) {
192 $lang = MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage(
$lang );
193 } elseif (
$lang ===
null ) {
194 $lang = MediaWikiServices::getInstance()->getContentLanguage();
198 foreach ( self::getGrantGroups( $grantsFilter ) as $group => $grants ) {
199 if ( $group ===
'hidden' ) {
202 $s .=
"*<span class=\"mw-grantgroup\">" .
203 wfMessage(
"grant-group-$group" )->inLanguage(
$lang )->text() .
"</span>\n";
204 $s .=
":" .
$lang->semicolonList( self::grantNames( $grants,
$lang ) ) .
"\n";
array $wgGrantPermissions
Map of (grant => right => boolean) Users authorize consumers (like Apps) to act on their behalf but o...
array $wgGrantPermissionGroups
Map of grants to their UI grouping.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
A collection of public static functions to deal with grants.
static getGrantsWikiText( $grantsFilter, $lang=null)
Generate wikitext to display a list of grants.
static grantName( $grant, $lang=null)
Fetch the display name of the grant.
static getHiddenGrants()
Get the list of grants that are hidden and should always be granted.
static grantNames(array $grants, $lang=null)
Fetch the display names for the grants.
static getGrantsLink( $grant, $lang=null)
Generate a link to Special:ListGrants for a particular grant name.
static getRightsByGrant()
Map all grants to corresponding user rights.
static grantsAreValid(array $grants)
Test that all grants in the list are known.
static getGrantRights( $grants)
Fetch the rights allowed by a set of grants.
static getGrantGroups( $grantsFilter=null)
Divide the grants into groups.
static getValidGrants()
List all known grants.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
foreach( $mmfl['setupFiles'] as $fileName) if($queue) if(empty( $mmfl['quiet'])) $s
if(!isset( $args[0])) $lang