Wikibase
MediaWiki Wikibase extension
|
Checks permissions to perform actions on the entity based on MediaWiki page permissions. More...
Public Member Functions | |
__construct (EntityNamespaceLookup $namespaceLookup, EntityTitleLookup $titleLookup, PermissionManager $permissionManager, array $availableRights) | |
getPermissionStatusForEntity (User $user, $action, EntityDocument $entity, $rigor=PermissionManager::RIGOR_SECURE) | |
getPermissionStatusForEntityId (User $user, $action, EntityId $entityId, $rigor=PermissionManager::RIGOR_SECURE) | |
Public Attributes | |
const | ACTION_MW_CREATE = 'create' |
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' |
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, $entityType, $rigor=PermissionManager::RIGOR_SECURE) | |
getMediaWikiPermissionsToCheck ( $action, $entityType) | |
mediawikiPermissionExists ( $permission) | |
getPermissionStatus (User $user, $permission, Title $title, $rigor=PermissionManager::RIGOR_SECURE) | |
Private Attributes | |
$namespaceLookup | |
$titleLookup | |
$permissionManager | |
$availableRights | |
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 |
|
private |
Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::getPermissionStatusForEntity | ( | User | $user, |
$action, | |||
EntityDocument | $entity, | ||
$rigor = PermissionManager::RIGOR_SECURE |
|||
) |
User | $user | |
string | $action | |
EntityDocument | $entity | |
string | $rigor |
InvalidArgumentException | if unknown permission is requested |
Implements Wikibase\Repo\Store\EntityPermissionChecker.
Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::getPermissionStatusForEntityId | ( | User | $user, |
$action, | |||
EntityId | $entityId, | ||
$rigor = PermissionManager::RIGOR_SECURE |
|||
) |
User | $user | |
string | $action | |
EntityId | $entityId | |
string | $rigor |
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 |
const Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::ACTION_MW_CREATE = 'create' |