MediaWiki  master
MediaWiki\Permissions\GrantsInfo Class Reference

Users can authorize applications to use their account via OAuth. More...

Collaboration diagram for MediaWiki\Permissions\GrantsInfo:

Public Member Functions

 __construct (ServiceOptions $options)
 
 getGrantGroups (array $grantsFilter=null)
 Divide the grants into groups. More...
 
 getGrantRights ( $grants)
 Fetch the rights allowed by a set of grants. More...
 
 getHiddenGrants ()
 Get the list of grants that are hidden and should always be granted. More...
 
 getRightsByGrant ()
 Map all grants to corresponding user rights. More...
 
 getValidGrants ()
 List all known grants. More...
 
 grantsAreValid (array $grants)
 Test that all grants in the list are known. More...
 

Public Attributes

const CONSTRUCTOR_OPTIONS
 

Private Attributes

ServiceOptions $options
 

Detailed Description

Users can authorize applications to use their account via OAuth.

Grants are used to limit permissions for these application. This service allows application logic to access grants.

Since
1.38

Definition at line 32 of file GrantsInfo.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Permissions\GrantsInfo::__construct ( ServiceOptions  $options)
Parameters
ServiceOptions$options

Definition at line 47 of file GrantsInfo.php.

References MediaWiki\Permissions\GrantsInfo\$options, and MediaWiki\Config\ServiceOptions\assertRequiredOptions().

Member Function Documentation

◆ getGrantGroups()

MediaWiki\Permissions\GrantsInfo::getGrantGroups ( array  $grantsFilter = null)

Divide the grants into groups.

Parameters
string[] | null$grantsFilter
Returns
string[][] Map of (group => (grant list))

Definition at line 106 of file GrantsInfo.php.

◆ getGrantRights()

MediaWiki\Permissions\GrantsInfo::getGrantRights (   $grants)

Fetch the rights allowed by a set of grants.

Parameters
string[] | string$grants
Returns
string[]

Definition at line 79 of file GrantsInfo.php.

◆ getHiddenGrants()

MediaWiki\Permissions\GrantsInfo::getHiddenGrants ( )

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

Returns
string[]

Definition at line 130 of file GrantsInfo.php.

◆ getRightsByGrant()

MediaWiki\Permissions\GrantsInfo::getRightsByGrant ( )

Map all grants to corresponding user rights.

Returns
string[][] grant => array of rights in the grant

Definition at line 66 of file GrantsInfo.php.

References $res.

◆ getValidGrants()

MediaWiki\Permissions\GrantsInfo::getValidGrants ( )

List all known grants.

Returns
string[]

Definition at line 58 of file GrantsInfo.php.

Referenced by MediaWiki\Permissions\GrantsInfo\grantsAreValid().

◆ grantsAreValid()

MediaWiki\Permissions\GrantsInfo::grantsAreValid ( array  $grants)

Test that all grants in the list are known.

Parameters
string[]$grants
Returns
bool

Definition at line 97 of file GrantsInfo.php.

References MediaWiki\Permissions\GrantsInfo\getValidGrants().

Member Data Documentation

◆ $options

ServiceOptions MediaWiki\Permissions\GrantsInfo::$options
private

Definition at line 42 of file GrantsInfo.php.

Referenced by MediaWiki\Permissions\GrantsInfo\__construct().

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\Permissions\GrantsInfo::CONSTRUCTOR_OPTIONS
Initial value:
= [
'GrantPermissions',
'GrantPermissionGroups',
]
Access: internal
For use by ServiceWiring

Definition at line 36 of file GrantsInfo.php.


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