MediaWiki master
Authority.php
Go to the documentation of this file.
1<?php
8
13
23interface Authority {
24
29 public const READ_NORMAL = IDBAccessObject::READ_NORMAL;
30
35 public const READ_LATEST = IDBAccessObject::READ_LATEST;
36
45 public function getUser(): UserIdentity;
46
56 public function getBlock( int $freshness = IDBAccessObject::READ_NORMAL ): ?Block;
57
74 public function isAllowed( string $permission, ?PermissionStatus $status = null ): bool;
75
88 public function isAllowedAny( ...$permissions ): bool;
89
102 public function isAllowedAll( ...$permissions ): bool;
103
119 public function probablyCan(
120 string $action,
121 PageIdentity $target,
122 ?PermissionStatus $status = null
123 ): bool;
124
144 public function definitelyCan(
145 string $action,
146 PageIdentity $target,
147 ?PermissionStatus $status = null
148 ): bool;
149
170 public function isDefinitelyAllowed(
171 string $action,
172 ?PermissionStatus $status = null
173 ): bool;
174
192 public function authorizeAction(
193 string $action,
194 ?PermissionStatus $status = null
195 ): bool;
196
214 public function authorizeRead(
215 string $action,
216 PageIdentity $target,
217 ?PermissionStatus $status = null
218 ): bool;
219
237 public function authorizeWrite(
238 string $action,
239 PageIdentity $target,
240 ?PermissionStatus $status = null
241 ): bool;
242
249 public function isRegistered(): bool;
250
257 public function isTemp(): bool;
258
265 public function isNamed(): bool;
266}
A StatusValue for permission errors.
Represents a block that may prevent users from performing specific operations.
Definition Block.php:31
Interface for objects (potentially) representing an editable wiki page.
This interface represents the authority associated with the current execution context,...
Definition Authority.php:23
isNamed()
Is the user a normal non-temporary registered user?
isAllowed(string $permission, ?PermissionStatus $status=null)
Checks whether this authority has the given permission in general.
isAllowedAll(... $permissions)
Checks whether this authority has any of the given permissions in general.
isDefinitelyAllowed(string $action, ?PermissionStatus $status=null)
Checks whether this authority is allowed to perform the given action.
definitelyCan(string $action, PageIdentity $target, ?PermissionStatus $status=null)
Checks whether this authority can perform the given action on the given target page.
getUser()
Returns the performer of the actions associated with this authority.
isTemp()
Is the user an autocreated temporary user?
isRegistered()
Get whether the user is registered.
authorizeAction(string $action, ?PermissionStatus $status=null)
Authorize an action.
authorizeWrite(string $action, PageIdentity $target, ?PermissionStatus $status=null)
Authorize write access.
authorizeRead(string $action, PageIdentity $target, ?PermissionStatus $status=null)
Authorize read access.
getBlock(int $freshness=IDBAccessObject::READ_NORMAL)
Returns any user block affecting the Authority.
probablyCan(string $action, PageIdentity $target, ?PermissionStatus $status=null)
Checks whether this authority can probably perform the given action on the given target page.
isAllowedAny(... $permissions)
Checks whether this authority has any of the given permissions in general.
Interface for objects representing user identity.
Interface for database access objects.