MediaWiki  master
Authority.php
Go to the documentation of this file.
1 <?php
22 
23 use IDBAccessObject;
27 
37 interface Authority {
38 
43  public const READ_NORMAL = IDBAccessObject::READ_NORMAL;
44 
49  public const READ_LATEST = IDBAccessObject::READ_LATEST;
50 
59  public function getUser(): UserIdentity;
60 
70  public function getBlock( int $freshness = self::READ_NORMAL ): ?Block;
71 
80  public function isAllowed( string $permission ): bool;
81 
94  public function isAllowedAny( ...$permissions ): bool;
95 
108  public function isAllowedAll( ...$permissions ): bool;
109 
121  public function probablyCan(
122  string $action,
123  PageIdentity $target,
124  PermissionStatus $status = null
125  ): bool;
126 
141  public function definitelyCan(
142  string $action,
143  PageIdentity $target,
144  PermissionStatus $status = null
145  ): bool;
146 
160  public function authorizeRead(
161  string $action,
162  PageIdentity $target,
163  PermissionStatus $status = null
164  ): bool;
165 
179  public function authorizeWrite(
180  string $action,
181  PageIdentity $target,
182  PermissionStatus $status = null
183  ): bool;
184 
185 }
Page\PageIdentity
Interface for objects (potentially) representing an editable wiki page.
Definition: PageIdentity.php:64
MediaWiki\Permissions\Authority\isAllowedAll
isAllowedAll(... $permissions)
Checks whether this authority has any of the given permissions in general.
MediaWiki\Permissions\Authority\getBlock
getBlock(int $freshness=self::READ_NORMAL)
Returns any user block affecting the Authority.
MediaWiki\Permissions\Authority\authorizeRead
authorizeRead(string $action, PageIdentity $target, PermissionStatus $status=null)
Authorize read access.
MediaWiki\Permissions\Authority\probablyCan
probablyCan(string $action, PageIdentity $target, PermissionStatus $status=null)
Checks whether this authority can probably perform the given action on the given target page.
IDBAccessObject
Interface for database access objects.
Definition: IDBAccessObject.php:57
MediaWiki\Permissions\Authority\getUser
getUser()
Returns the performer of the actions associated with this authority.
MediaWiki\User\UserIdentity
Interface for objects representing user identity.
Definition: UserIdentity.php:39
MediaWiki\Permissions\Authority\isAllowedAny
isAllowedAny(... $permissions)
Checks whether this authority has any of the given permissions in general.
MediaWiki\Permissions\Authority\authorizeWrite
authorizeWrite(string $action, PageIdentity $target, PermissionStatus $status=null)
Authorize write access.
MediaWiki\Permissions\Authority\definitelyCan
definitelyCan(string $action, PageIdentity $target, PermissionStatus $status=null)
Checks whether this authority can perform the given action on the given target page.
MediaWiki\Block\Block
Represents a block that may prevent users from performing specific operations.
Definition: Block.php:37
MediaWiki\Permissions\Authority
This interface represents the authority associated the current execution context, such as a web reque...
Definition: Authority.php:37
MediaWiki\Permissions\PermissionStatus
A StatusValue for permission errors.
Definition: PermissionStatus.php:35
MediaWiki\$action
string $action
Cache what action this request is.
Definition: MediaWiki.php:45
MediaWiki\Permissions\Authority\isAllowed
isAllowed(string $permission)
Checks whether this authority has the given permission in general.
MediaWiki\Permissions
Definition: Authority.php:21