MediaWiki  master
Authority.php
Go to the documentation of this file.
1 <?php
22 
25 
30 interface Authority {
31 
40  public function getUser(): UserIdentity;
41 
50  public function isAllowed( string $permission ): bool;
51 
64  public function isAllowedAny( ...$permissions ): bool;
65 
78  public function isAllowedAll( ...$permissions ): bool;
79 
91  public function probablyCan(
92  string $action,
93  PageIdentity $target,
94  PermissionStatus $status = null
95  ): bool;
96 
111  public function definitelyCan(
112  string $action,
113  PageIdentity $target,
114  PermissionStatus $status = null
115  ): bool;
116 
130  public function authorizeRead(
131  string $action,
132  PageIdentity $target,
133  PermissionStatus $status = null
134  ): bool;
135 
149  public function authorizeWrite(
150  string $action,
151  PageIdentity $target,
152  PermissionStatus $status = null
153  ): bool;
154 
155 }
Page\PageIdentity
Interface for objects (potentially) representing an editable wiki page.
Definition: PageIdentity.php:65
MediaWiki\Permissions\Authority\isAllowedAll
isAllowedAll(... $permissions)
Checks whether this authority has any of the given permissions in general.
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.
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\Permissions\Authority
Definition: Authority.php:30
MediaWiki\Permissions\PermissionStatus
A StatusValue for permission errors.
Definition: PermissionStatus.php:34
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