Service interface for checking a user's permissions on a given entity.
More...
|
| getPermissionStatusForEntity (User $user, $action, EntityDocument $entity, $rigor=PermissionManager::RIGOR_SECURE) |
| Check whether the given user has the permission to perform the given action on an entity. More...
|
|
| getPermissionStatusForEntityId (User $user, $action, EntityId $entityId, $rigor=PermissionManager::RIGOR_SECURE) |
| Check whether the given user has the permission to perform the given action on an entity. More...
|
|
Service interface for checking a user's permissions on a given entity.
- Copyright
- GPL-2.0-or-later
- Author
- Daniel Kinzler
◆ getPermissionStatusForEntity()
Wikibase\Repo\Store\EntityPermissionChecker::getPermissionStatusForEntity |
( |
User |
$user, |
|
|
|
$action, |
|
|
EntityDocument |
$entity, |
|
|
|
$rigor = PermissionManager::RIGOR_SECURE |
|
) |
| |
Check whether the given user has the permission to perform the given action on an entity.
This will perform a check based on the entity's ID if the entity has an ID set (that is, the entity "exists"), or based merely on the entity type, in case the entity does not exist.
- Parameters
-
User | $user | |
string | $action | |
EntityDocument | $entity | |
string | $rigor | Flag for allowing quick permission checking. One of the PermissionManager::RIGOR_* constants. If set to 'PermissionManager::RIGOR_QUICK', implementations may return inaccurate results if determining the accurate result would be slow (e.g. checking for cascading protection). This is intended as an optimization for non-critical checks, e.g. for showing or hiding UI elements. |
- Exceptions
-
InvalidArgumentException | if unknown permission is requested |
- Returns
- Status a status object representing the check's result.
Implemented in Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker.
◆ getPermissionStatusForEntityId()
Wikibase\Repo\Store\EntityPermissionChecker::getPermissionStatusForEntityId |
( |
User |
$user, |
|
|
|
$action, |
|
|
EntityId |
$entityId, |
|
|
|
$rigor = PermissionManager::RIGOR_SECURE |
|
) |
| |
Check whether the given user has the permission to perform the given action on an entity.
This requires the ID of an existing entity.
- Parameters
-
User | $user | |
string | $action | |
EntityId | $entityId | |
string | $rigor | Flag for allowing quick permission checking. One of the PermissionManager::RIGOR_* constants. If set to 'PermissionManager::RIGOR_QUICK', implementations may return inaccurate results if determining the accurate result would be slow (e.g. checking for cascading protection). This is intended as an optimization for non-critical checks, e.g. for showing or hiding UI elements. |
- Exceptions
-
InvalidArgumentException | if unknown permission is requested |
- Returns
- Status a status object representing the check's result.
Implemented in Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker.
◆ ACTION_EDIT
const Wikibase\Repo\Store\EntityPermissionChecker::ACTION_EDIT = 'edit' |
◆ ACTION_EDIT_TERMS
const Wikibase\Repo\Store\EntityPermissionChecker::ACTION_EDIT_TERMS = 'term' |
◆ ACTION_MERGE
const Wikibase\Repo\Store\EntityPermissionChecker::ACTION_MERGE = 'merge' |
◆ ACTION_READ
const Wikibase\Repo\Store\EntityPermissionChecker::ACTION_READ = 'read' |
◆ ACTION_REDIRECT
const Wikibase\Repo\Store\EntityPermissionChecker::ACTION_REDIRECT = 'redirect' |
The documentation for this interface was generated from the following file: