MediaWiki REL1_35
MediaWiki\Block\BlockPermissionChecker Class Reference

Block permissions. More...

Collaboration diagram for MediaWiki\Block\BlockPermissionChecker:

Public Member Functions

 __construct (PermissionManager $permissionManager, $target, User $performer)
 
 checkBlockPermissions ()
 Checks block-related permissions (doesn't check any other permissions)
 

Private Attributes

User $performer
 Block performer.
 
PermissionManager $permissionManager
 
UserIdentity string $target
 Block target.
 
 $targetType = null
 

Detailed Description

Block permissions.

This class is responsible for making sure a user has permission to block

This class is usable for both blocking as well as the unblocking process.

Since
1.35

Definition at line 38 of file BlockPermissionChecker.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ checkBlockPermissions()

MediaWiki\Block\BlockPermissionChecker::checkBlockPermissions ( )

Checks block-related permissions (doesn't check any other permissions)

T17810: Sitewide blocked admins should not be able to block/unblock others with one exception; they can block the user who blocked them, to reduce advantage of a malicious account blocking all admins (T150826).

T208965: Partially blocked admins can block and unblock others as normal.

Returns
bool|string True when checks passed, message code for failures

Definition at line 80 of file BlockPermissionChecker.php.

References MediaWiki\User\UserIdentity\getId(), and MediaWiki\User\UserIdentity\getName().

Member Data Documentation

◆ $performer

User MediaWiki\Block\BlockPermissionChecker::$performer
private

Block performer.

Definition at line 52 of file BlockPermissionChecker.php.

Referenced by MediaWiki\Block\BlockPermissionChecker\__construct().

◆ $permissionManager

PermissionManager MediaWiki\Block\BlockPermissionChecker::$permissionManager
private

◆ $target

UserIdentity string MediaWiki\Block\BlockPermissionChecker::$target
private

Block target.

Definition at line 42 of file BlockPermissionChecker.php.

Referenced by MediaWiki\Block\BlockPermissionChecker\__construct().

◆ $targetType

MediaWiki\Block\BlockPermissionChecker::$targetType = null
private

Definition at line 47 of file BlockPermissionChecker.php.


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