MediaWiki master
|
Represents an authority that has all permissions. More...
Inherits MediaWiki\Permissions\Authority.
Public Member Functions | ||||||||||
__construct (UserIdentity $actor, $isTemp=false) | ||||||||||
authorizeAction (string $action, PermissionStatus $status=null) | ||||||||||
Authorize an action.This should be used immediately before performing the action.Calling this method may have non-trivial side-effects, such as incrementing a rate limit counter.
| ||||||||||
authorizeRead (string $action, PageIdentity $target, PermissionStatus $status=null) | ||||||||||
Authorize read access.This should be used immediately before performing read access on restricted information.Calling this method may have non-trivial side-effects, such as incrementing a rate limit counter.
| ||||||||||
authorizeWrite (string $action, PageIdentity $target, PermissionStatus $status=null) | ||||||||||
Authorize write access.This should be used immediately before updating persisted information.Calling this method may have non-trivial side-effects, such as incrementing a rate limit counter.
| ||||||||||
definitelyCan (string $action, PageIdentity $target, PermissionStatus $status=null) | ||||||||||
Checks whether this authority can perform the given action on the given target page.This method performs a thorough check, but does not protect against race conditions. It is intended to be used when a user is intending to perform an action, but has not yet committed to it. For example, when a user goes to the edit page of an article, this method may be used to determine whether the user should be presented with a warning and a read-only view instead.This method may apply rate limit checks and evaluate user blocks.
| ||||||||||
getBlock (int $freshness=self::READ_NORMAL) | ||||||||||
Returns any user block affecting the Authority.
| ||||||||||
getUser () | ||||||||||
Returns the performer of the actions associated with this authority.Actions performed under this authority should generally be attributed to the user identity returned by this method.
| ||||||||||
isAllowed (string $permission, PermissionStatus $status=null) | ||||||||||
Checks whether this authority has the given permission in general.For some permissions, exceptions may exist, both positive and negative, on a per-target basis. This method offers a fast, lightweight check, but may produce false positives. It is intended for determining which UI elements should be offered to the user.This method will not apply rate limit checks or evaluate user blocks.
| ||||||||||
isAllowedAll (... $permissions) | ||||||||||
Checks whether this authority has any of the given permissions in general.Implementations must ensure that this method returns false if isAllowed would return false for any of the given permissions. Calling isAllowedAll() with one parameter must be equivalent to calling isAllowed(). Calling isAllowedAny() with no parameter is not allowed.
| ||||||||||
isAllowedAny (... $permissions) | ||||||||||
Checks whether this authority has any of the given permissions in general.Implementations must ensure that this method returns true if isAllowed would return true for any of the given permissions. Calling isAllowedAny() with one parameter must be equivalent to calling isAllowed(). Calling isAllowedAny() with no parameter is not allowed.
| ||||||||||
isDefinitelyAllowed (string $action, PermissionStatus $status=null) | ||||||||||
Checks whether this authority is allowed to perform the given action.This method performs a thorough check, but does not protect against race conditions. It is intended to be used when a user is intending to perform an action, but has not yet committed to it. For example, when a user visits their preferences page, this method may be used to determine whether the user should have the option to change their email address.This method may apply rate limit checks and evaluate user blocks.
| ||||||||||
isNamed () | ||||||||||
Is the user a normal non-temporary registered user? | ||||||||||
isRegistered () | ||||||||||
Get whether the user is registered. | ||||||||||
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.This method offers a fast, lightweight check, but may produce false positives. It is intended for determining which UI elements should be offered to the user. This method will not apply rate limit checks or evaluate user blocks.
| ||||||||||
Represents an authority that has all permissions.
This is intended for use in maintenance scripts and tests.
Definition at line 35 of file UltimateAuthority.php.
MediaWiki\Permissions\UltimateAuthority::__construct | ( | UserIdentity | $actor, |
$isTemp = false |
|||
) |
UserIdentity | $actor | |
bool | $isTemp |
Definition at line 48 of file UltimateAuthority.php.
References MediaWiki\Permissions\UltimateAuthority\isTemp().
MediaWiki\Permissions\UltimateAuthority::authorizeAction | ( | string | $action, |
PermissionStatus | $status = null |
||
) |
Authorize an action.This should be used immediately before performing the action.Calling this method may have non-trivial side-effects, such as incrementing a rate limit counter.
string | $action | |
PermissionStatus | null | $status | aggregator for failures |
Implements MediaWiki\Permissions\Authority.
Definition at line 110 of file UltimateAuthority.php.
MediaWiki\Permissions\UltimateAuthority::authorizeRead | ( | string | $action, |
PageIdentity | $target, | ||
PermissionStatus | $status = null |
||
) |
Authorize read access.This should be used immediately before performing read access on restricted information.Calling this method may have non-trivial side-effects, such as incrementing a rate limit counter.
string | $action | |
PageIdentity | $target | |
PermissionStatus | null | $status | aggregator for failures |
Implements MediaWiki\Permissions\Authority.
Definition at line 115 of file UltimateAuthority.php.
MediaWiki\Permissions\UltimateAuthority::authorizeWrite | ( | string | $action, |
PageIdentity | $target, | ||
PermissionStatus | $status = null |
||
) |
Authorize write access.This should be used immediately before updating persisted information.Calling this method may have non-trivial side-effects, such as incrementing a rate limit counter.
string | $action | |
PageIdentity | $target | |
PermissionStatus | null | $status | aggregator for failures |
Implements MediaWiki\Permissions\Authority.
Definition at line 124 of file UltimateAuthority.php.
MediaWiki\Permissions\UltimateAuthority::definitelyCan | ( | string | $action, |
PageIdentity | $target, | ||
PermissionStatus | $status = null |
||
) |
Checks whether this authority can perform the given action on the given target page.This method performs a thorough check, but does not protect against race conditions. It is intended to be used when a user is intending to perform an action, but has not yet committed to it. For example, when a user goes to the edit page of an article, this method may be used to determine whether the user should be presented with a warning and a read-only view instead.This method may apply rate limit checks and evaluate user blocks.
string | $action | |
PageIdentity | $target | |
PermissionStatus | null | $status | aggregator for failures |
Implements MediaWiki\Permissions\Authority.
Definition at line 96 of file UltimateAuthority.php.
MediaWiki\Permissions\UltimateAuthority::getBlock | ( | int | $freshness = self::READ_NORMAL | ) |
Returns any user block affecting the Authority.
int | $freshness | Indicates whether slightly stale data is acceptable in, exchange for a fast response. |
Implements MediaWiki\Permissions\Authority.
Definition at line 59 of file UltimateAuthority.php.
MediaWiki\Permissions\UltimateAuthority::getUser | ( | ) |
Returns the performer of the actions associated with this authority.Actions performed under this authority should generally be attributed to the user identity returned by this method.
Implements MediaWiki\Permissions\Authority.
Definition at line 54 of file UltimateAuthority.php.
MediaWiki\Permissions\UltimateAuthority::isAllowed | ( | string | $permission, |
PermissionStatus | $status = null |
||
) |
Checks whether this authority has the given permission in general.For some permissions, exceptions may exist, both positive and negative, on a per-target basis. This method offers a fast, lightweight check, but may produce false positives. It is intended for determining which UI elements should be offered to the user.This method will not apply rate limit checks or evaluate user blocks.
string | $permission | |
PermissionStatus | null | $status |
Implements MediaWiki\Permissions\Authority.
Definition at line 64 of file UltimateAuthority.php.
MediaWiki\Permissions\UltimateAuthority::isAllowedAll | ( | $permissions | ) |
Checks whether this authority has any of the given permissions in general.Implementations must ensure that this method returns false if isAllowed would return false for any of the given permissions. Calling isAllowedAll() with one parameter must be equivalent to calling isAllowed(). Calling isAllowedAny() with no parameter is not allowed.
string | ...$permissions Permissions to test. At least one must be given. |
Implements MediaWiki\Permissions\Authority.
Definition at line 78 of file UltimateAuthority.php.
MediaWiki\Permissions\UltimateAuthority::isAllowedAny | ( | $permissions | ) |
Checks whether this authority has any of the given permissions in general.Implementations must ensure that this method returns true if isAllowed would return true for any of the given permissions. Calling isAllowedAny() with one parameter must be equivalent to calling isAllowed(). Calling isAllowedAny() with no parameter is not allowed.
string | ...$permissions Permissions to test. At least one must be given. |
Implements MediaWiki\Permissions\Authority.
Definition at line 69 of file UltimateAuthority.php.
MediaWiki\Permissions\UltimateAuthority::isDefinitelyAllowed | ( | string | $action, |
PermissionStatus | $status = null |
||
) |
Checks whether this authority is allowed to perform the given action.This method performs a thorough check, but does not protect against race conditions. It is intended to be used when a user is intending to perform an action, but has not yet committed to it. For example, when a user visits their preferences page, this method may be used to determine whether the user should have the option to change their email address.This method may apply rate limit checks and evaluate user blocks.
string | $action | |
PermissionStatus | null | $status | aggregator for failures |
Implements MediaWiki\Permissions\Authority.
Definition at line 105 of file UltimateAuthority.php.
MediaWiki\Permissions\UltimateAuthority::isNamed | ( | ) |
Is the user a normal non-temporary registered user?
Implements MediaWiki\Permissions\Authority.
Definition at line 140 of file UltimateAuthority.php.
MediaWiki\Permissions\UltimateAuthority::isRegistered | ( | ) |
Get whether the user is registered.
Implements MediaWiki\Permissions\Authority.
Definition at line 132 of file UltimateAuthority.php.
MediaWiki\Permissions\UltimateAuthority::isTemp | ( | ) |
Is the user an autocreated temporary user?
Implements MediaWiki\Permissions\Authority.
Definition at line 136 of file UltimateAuthority.php.
Referenced by MediaWiki\Permissions\UltimateAuthority\__construct().
MediaWiki\Permissions\UltimateAuthority::probablyCan | ( | string | $action, |
PageIdentity | $target, | ||
PermissionStatus | $status = null |
||
) |
Checks whether this authority can probably perform the given action on the given target page.This method offers a fast, lightweight check, but may produce false positives. It is intended for determining which UI elements should be offered to the user. This method will not apply rate limit checks or evaluate user blocks.
string | $action | |
PageIdentity | $target | |
PermissionStatus | null | $status | aggregator for failures |
Implements MediaWiki\Permissions\Authority.
Definition at line 87 of file UltimateAuthority.php.