MediaWiki  master
MediaWiki\Permissions\GroupPermissionsLookup Class Reference

Public Member Functions

 __construct (ServiceOptions $options)
 
 getGrantedPermissions (string $group)
 Get a list of permissions granted to this group. More...
 
 getGroupPermissions (array $groups)
 Get the permissions associated with a given list of groups. More...
 
 getGroupsWithPermission (string $permission)
 Get all the groups who have a given permission. More...
 
 getRevokedPermissions (string $group)
 Get a list of permissions revoked from this group. More...
 
 groupHasPermission (string $group, string $permission)
 Check, if the given group has the given permission. More...
 

Private Attributes

string[] $groupInheritance
 
array[] $groupPermissions
 
array[] $revokePermissions
 

Detailed Description

Definition at line 30 of file GroupPermissionsLookup.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Permissions\GroupPermissionsLookup::__construct ( ServiceOptions  $options)

Member Function Documentation

◆ getGrantedPermissions()

MediaWiki\Permissions\GroupPermissionsLookup::getGrantedPermissions ( string  $group)

Get a list of permissions granted to this group.

This must NOT be used for permissions checking as it does not check whether a permission has been revoked from this group.

Parameters
string$groupGroup to get permissions of
Returns
string[]
Since
1.38

Definition at line 109 of file GroupPermissionsLookup.php.

◆ getGroupPermissions()

MediaWiki\Permissions\GroupPermissionsLookup::getGroupPermissions ( array  $groups)

Get the permissions associated with a given list of groups.

Parameters
string[]$groupsinternal group names
Returns
string[] permission key names for given groups combined

Definition at line 150 of file GroupPermissionsLookup.php.

◆ getGroupsWithPermission()

MediaWiki\Permissions\GroupPermissionsLookup::getGroupsWithPermission ( string  $permission)

Get all the groups who have a given permission.

Parameters
string$permission
Returns
string[] internal group names with the given permission

Definition at line 190 of file GroupPermissionsLookup.php.

References MediaWiki\Permissions\GroupPermissionsLookup\groupHasPermission().

◆ getRevokedPermissions()

MediaWiki\Permissions\GroupPermissionsLookup::getRevokedPermissions ( string  $group)

Get a list of permissions revoked from this group.

Parameters
string$groupGroup to get revoked permissions of
Returns
string[]
Since
1.38

Definition at line 130 of file GroupPermissionsLookup.php.

◆ groupHasPermission()

MediaWiki\Permissions\GroupPermissionsLookup::groupHasPermission ( string  $group,
string  $permission 
)

Check, if the given group has the given permission.

If you're wanting to check whether all users have a permission, use PermissionManager::isEveryoneAllowed() instead. That properly checks if it's revoked from anyone.

Parameters
string$groupGroup to check
string$permissionRole to check
Returns
bool

Definition at line 73 of file GroupPermissionsLookup.php.

Referenced by MediaWiki\Permissions\GroupPermissionsLookup\getGroupsWithPermission().

Member Data Documentation

◆ $groupInheritance

string [] MediaWiki\Permissions\GroupPermissionsLookup::$groupInheritance
private

Definition at line 49 of file GroupPermissionsLookup.php.

◆ $groupPermissions

array [] MediaWiki\Permissions\GroupPermissionsLookup::$groupPermissions
private
Initial value:
=[,,,]
public const CONSTRUCTOR_OPTIONS
'GroupInheritsPermissions'
'GroupPermissions'
'RevokePermissions'

Definition at line 43 of file GroupPermissionsLookup.php.

◆ $revokePermissions

array [] MediaWiki\Permissions\GroupPermissionsLookup::$revokePermissions
private

Definition at line 46 of file GroupPermissionsLookup.php.


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