MediaWiki master
MediaWiki\User\RestrictedUserGroupConfigReader Class Reference

A helper class to read the restricted user groups configuration for a given wiki. More...

Public Member Functions

 __construct (private readonly ServiceOptions $options, private readonly UserRequirementsConditionValidator $userRequirementsConditionValidator,)
 
 getConfig (false|string $wiki=false, string $scope=self::SCOPE_LOCAL)
 Reads the restricted group configuration for the specified wiki, either from the ServiceOptions provided to the constructor (if the wiki is the local wiki) or from the global $wgConf variable (otherwise).
 

Public Attributes

const CONSTRUCTOR_OPTIONS
 
const SCOPE_LOCAL = 'local'
 Scope value representing user groups as supported by MediaWiki core.
 

Detailed Description

A helper class to read the restricted user groups configuration for a given wiki.

Since
1.46

Definition at line 18 of file RestrictedUserGroupConfigReader.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\User\RestrictedUserGroupConfigReader::__construct ( private readonly ServiceOptions $options,
private readonly UserRequirementsConditionValidator $userRequirementsConditionValidator )

Definition at line 31 of file RestrictedUserGroupConfigReader.php.

Member Function Documentation

◆ getConfig()

MediaWiki\User\RestrictedUserGroupConfigReader::getConfig ( false|string $wiki = false,
string $scope = self::SCOPE_LOCAL )

Reads the restricted group configuration for the specified wiki, either from the ServiceOptions provided to the constructor (if the wiki is the local wiki) or from the global $wgConf variable (otherwise).

Only restrictions relevant for the given scope are returned: restrictions without a scope key are always included, while restrictions with a scope key are only included if the requested scope is listed.

Parameters
false | string$wikiThe wiki ID for which to read the configuration. false means the current wiki.
string$scopeThe scope for which to read the configuration. Defaults to {
See also
self::SCOPE_LOCAL}.
Returns
array<string, UserGroupRestrictions> An array mapping group names to their restrictions.

Definition at line 46 of file RestrictedUserGroupConfigReader.php.

Member Data Documentation

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\User\RestrictedUserGroupConfigReader::CONSTRUCTOR_OPTIONS
Initial value:
= [
]
const RestrictedGroups
Name constant for the RestrictedGroups setting, for use with Config::get()
Access: internal

Definition at line 21 of file RestrictedUserGroupConfigReader.php.

◆ SCOPE_LOCAL

const MediaWiki\User\RestrictedUserGroupConfigReader::SCOPE_LOCAL = 'local'

Scope value representing user groups as supported by MediaWiki core.

Other scopes may be added by extensions.

Definition at line 29 of file RestrictedUserGroupConfigReader.php.


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