MediaWiki
REL1_41
Authority.php
Go to the documentation of this file.
1
<?php
21
namespace
MediaWiki\Permissions
;
22
23
use
IDBAccessObject
;
24
use
MediaWiki\Block\Block
;
25
use
MediaWiki\Page\PageIdentity
;
26
use
MediaWiki\User\UserIdentity
;
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
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
}
MediaWiki\Permissions\PermissionStatus
A StatusValue for permission errors.
Definition
PermissionStatus.php:39
IDBAccessObject
Interface for database access objects.
Definition
IDBAccessObject.php:57
MediaWiki\Block\Block
Represents a block that may prevent users from performing specific operations.
Definition
Block.php:41
MediaWiki\Page\PageIdentity
Interface for objects (potentially) representing an editable wiki page.
Definition
PageIdentity.php:67
MediaWiki\Permissions\Authority
This interface represents the authority associated the current execution context, such as a web reque...
Definition
Authority.php:37
MediaWiki\Permissions\Authority\isNamed
isNamed()
Is the user a normal non-temporary registered user?
MediaWiki\Permissions\Authority\isAllowedAll
isAllowedAll(... $permissions)
Checks whether this authority has any of the given permissions in general.
MediaWiki\Permissions\Authority\authorizeAction
authorizeAction(string $action, PermissionStatus $status=null)
Authorize an action.
MediaWiki\Permissions\Authority\authorizeWrite
authorizeWrite(string $action, PageIdentity $target, PermissionStatus $status=null)
Authorize write access.
MediaWiki\Permissions\Authority\getUser
getUser()
Returns the performer of the actions associated with this authority.
MediaWiki\Permissions\Authority\isTemp
isTemp()
Is the user an autocreated temporary user?
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\getBlock
getBlock(int $freshness=self::READ_NORMAL)
Returns any user block affecting the Authority.
MediaWiki\Permissions\Authority\isRegistered
isRegistered()
Get whether the user is registered.
MediaWiki\Permissions\Authority\isAllowed
isAllowed(string $permission, PermissionStatus $status=null)
Checks whether this authority has the given permission in general.
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\isDefinitelyAllowed
isDefinitelyAllowed(string $action, PermissionStatus $status=null)
Checks whether this authority is allowed to perform the given action.
MediaWiki\Permissions\Authority\authorizeRead
authorizeRead(string $action, PageIdentity $target, PermissionStatus $status=null)
Authorize read access.
MediaWiki\Permissions\Authority\isAllowedAny
isAllowedAny(... $permissions)
Checks whether this authority has any of the given permissions in general.
MediaWiki\User\UserIdentity
Interface for objects representing user identity.
Definition
UserIdentity.php:39
MediaWiki\Permissions
Definition
Authority.php:21
includes
Permissions
Authority.php
Generated on Sat Nov 23 2024 08:24:22 for MediaWiki by
1.10.0