MediaWiki REL1_41
Authority.php
Go to the documentation of this file.
1<?php
22
27
37interface 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
88 public function isAllowed( string $permission, PermissionStatus $status = null ): bool;
89
102 public function isAllowedAny( ...$permissions ): bool;
103
116 public function isAllowedAll( ...$permissions ): bool;
117
133 public function probablyCan(
134 string $action,
135 PageIdentity $target,
136 PermissionStatus $status = null
137 ): bool;
138
158 public function definitelyCan(
159 string $action,
160 PageIdentity $target,
161 PermissionStatus $status = null
162 ): bool;
163
184 public function isDefinitelyAllowed(
185 string $action,
186 PermissionStatus $status = null
187 ): bool;
188
206 public function authorizeAction(
207 string $action,
208 PermissionStatus $status = null
209 ): bool;
210
228 public function authorizeRead(
229 string $action,
230 PageIdentity $target,
231 PermissionStatus $status = null
232 ): bool;
233
251 public function authorizeWrite(
252 string $action,
253 PageIdentity $target,
254 PermissionStatus $status = null
255 ): bool;
256
263 public function isRegistered(): bool;
264
271 public function isTemp(): bool;
272
279 public function isNamed(): bool;
280}
A StatusValue for permission errors.
Interface for database access objects.
Represents a block that may prevent users from performing specific operations.
Definition Block.php:41
Interface for objects (potentially) representing an editable wiki page.
This interface represents the authority associated the current execution context, such as a web reque...
Definition Authority.php:37
isNamed()
Is the user a normal non-temporary registered user?
isAllowedAll(... $permissions)
Checks whether this authority has any of the given permissions in general.
authorizeAction(string $action, PermissionStatus $status=null)
Authorize an action.
authorizeWrite(string $action, PageIdentity $target, PermissionStatus $status=null)
Authorize write access.
getUser()
Returns the performer of the actions associated with this authority.
isTemp()
Is the user an autocreated temporary user?
probablyCan(string $action, PageIdentity $target, PermissionStatus $status=null)
Checks whether this authority can probably perform the given action on the given target page.
getBlock(int $freshness=self::READ_NORMAL)
Returns any user block affecting the Authority.
isRegistered()
Get whether the user is registered.
isAllowed(string $permission, PermissionStatus $status=null)
Checks whether this authority has the given permission in general.
definitelyCan(string $action, PageIdentity $target, PermissionStatus $status=null)
Checks whether this authority can perform the given action on the given target page.
isDefinitelyAllowed(string $action, PermissionStatus $status=null)
Checks whether this authority is allowed to perform the given action.
authorizeRead(string $action, PageIdentity $target, PermissionStatus $status=null)
Authorize read access.
isAllowedAny(... $permissions)
Checks whether this authority has any of the given permissions in general.
Interface for objects representing user identity.