MediaWiki REL1_39
MediaWiki\Permissions\GrantsInfo Class Reference

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

Public Member Functions

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

Public Attributes

const CONSTRUCTOR_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 33 of file GrantsInfo.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 48 of file GrantsInfo.php.

References 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 107 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 80 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 131 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 67 of file GrantsInfo.php.

References $res.

◆ getValidGrants()

MediaWiki\Permissions\GrantsInfo::getValidGrants ( )

List all known grants.

Returns
string[]

Definition at line 59 of file GrantsInfo.php.

◆ grantsAreValid()

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

Test that all grants in the list are known.

Parameters
string[]$grants
Returns
bool

Definition at line 98 of file GrantsInfo.php.

Member Data Documentation

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\Permissions\GrantsInfo::CONSTRUCTOR_OPTIONS
Initial value:
= [
]
const GrantPermissionGroups
Name constant for the GrantPermissionGroups setting, for use with Config::get()
const GrantPermissions
Name constant for the GrantPermissions setting, for use with Config::get()
Access: internal
For use by ServiceWiring

Definition at line 37 of file GrantsInfo.php.


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