MediaWiki  master
PermissionStatus.php
Go to the documentation of this file.
1 <?php
21 namespace MediaWiki\Permissions;
22 
24 use StatusValue;
25 
36 
38  private $block = null;
39 
51  public function getBlock(): ?Block {
52  return $this->block;
53  }
54 
60  public function setBlock( Block $block ): void {
61  $this->block = $block;
62  }
63 
67  public static function newEmpty() {
68  return new static();
69  }
70 
78  public function toLegacyErrorArray(): array {
79  return $this->getStatusArray();
80  }
81 
82 }
StatusValue
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition: StatusValue.php:43
MediaWiki\Permissions\PermissionStatus\newEmpty
static newEmpty()
Definition: PermissionStatus.php:67
MediaWiki\Permissions\PermissionStatus\toLegacyErrorArray
toLegacyErrorArray()
Returns this permission status in legacy error array format.
Definition: PermissionStatus.php:78
MediaWiki\Permissions\PermissionStatus\getBlock
getBlock()
Returns the user block that contributed to permissions being denied, if such a block was provided via...
Definition: PermissionStatus.php:51
MediaWiki\Permissions\PermissionStatus\setBlock
setBlock(Block $block)
Definition: PermissionStatus.php:60
StatusValue\getStatusArray
getStatusArray( $type=false)
Returns a list of status messages of the given type (or all if false)
Definition: StatusValue.php:439
MediaWiki\Block\Block
Represents a block that may prevent users from performing specific operations.
Definition: Block.php:37
MediaWiki\Permissions\PermissionStatus\$block
Block $block
Definition: PermissionStatus.php:38
MediaWiki\Permissions\PermissionStatus
A StatusValue for permission errors.
Definition: PermissionStatus.php:35
MediaWiki\Permissions
Definition: Authority.php:21