|
Wikibase
MediaWiki Wikibase extension
|
Checks permissions to perform actions on the entity based on MediaWiki page permissions. More...
Inheritance diagram for Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker:
Collaboration diagram for Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker:Public Member Functions | |||||||||||||||
| __construct (EntityNamespaceLookup $namespaceLookup, EntityTitleLookup $titleLookup, PermissionManager $permissionManager, array $availableRights) | |||||||||||||||
| getPermissionStatusForEntity (User $user, string $action, EntityDocument $entity, string $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.
| |||||||||||||||
| getPermissionStatusForEntityId (User $user, string $action, EntityId $entityId, string $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.
| |||||||||||||||
Private Member Functions | |
| getPermissionStatusForEntityType (User $user, array $actions, $type, $rigor=PermissionManager::RIGOR_SECURE) | |
| Check whether the given user has the permission to perform the given action on a given entity type. | |
| getPageTitleInEntityNamespace ( $entityType) | |
| checkPermissionsForActions (User $user, array $actions, Title $title, string $entityType, string $rigor=PermissionManager::RIGOR_SECURE) | |
| getMediaWikiPermissionsToCheck (string $action, string $entityType) | |
| mediawikiPermissionExists (string $permission) | |
| mergeStatus (PermissionStatus $mergeTarget, PermissionStatus $mergeSource) | |
Private Attributes | |
| const | ACTION_MW_CREATE = 'create' |
| $namespaceLookup | |
| $titleLookup | |
| $permissionManager | |
| $availableRights | |
Additional Inherited Members | |
Public Attributes inherited from Wikibase\Repo\Store\EntityPermissionChecker | |
| const | ACTION_READ = 'read' |
| const | ACTION_EDIT = 'edit' |
| const | ACTION_EDIT_TERMS = 'term' |
| const | ACTION_MERGE = 'merge' |
| const | ACTION_REDIRECT = 'redirect' |
Checks permissions to perform actions on the entity based on MediaWiki page permissions.
For more information on the relationship between entities and wiki pages, see docs/entity-storage.wiki.
| Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::__construct | ( | EntityNamespaceLookup | $namespaceLookup, |
| EntityTitleLookup | $titleLookup, | ||
| PermissionManager | $permissionManager, | ||
| array | $availableRights ) |
| EntityNamespaceLookup | $namespaceLookup | |
| EntityTitleLookup | $titleLookup | |
| PermissionManager | $permissionManager | |
| string[] | $availableRights |
|
private |
|
private |
|
private |
| string | $entityType |
| Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::getPermissionStatusForEntity | ( | User | $user, |
| string | $action, | ||
| EntityDocument | $entity, | ||
| string | $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.
| 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. |
| InvalidArgumentException | if unknown permission is requested |
Implements Wikibase\Repo\Store\EntityPermissionChecker.
| Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::getPermissionStatusForEntityId | ( | User | $user, |
| string | $action, | ||
| EntityId | $entityId, | ||
| string | $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.
| 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. |
| InvalidArgumentException | if unknown permission is requested |
Implements Wikibase\Repo\Store\EntityPermissionChecker.
|
private |
Check whether the given user has the permission to perform the given action on a given entity type.
This does not require an entity to exist.
Useful especially for checking whether the user is allowed to create an entity of a given type.
| User | $user | |
| string[] | $actions | |
| string | $type | |
| 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. |
| InvalidArgumentException | if unknown permission is requested |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |