Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker Class Reference

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, $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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::__construct ( EntityNamespaceLookup  $namespaceLookup,
EntityTitleLookup  $titleLookup,
PermissionManager  $permissionManager,
array  $availableRights 
)
Parameters
EntityNamespaceLookup$namespaceLookup
EntityTitleLookup$titleLookup
PermissionManager$permissionManager
string[]$availableRights

Member Function Documentation

◆ checkPermissionsForActions()

Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::checkPermissionsForActions ( User  $user,
array  $actions,
Title  $title,
  $entityType,
  $rigor = PermissionManager::RIGOR_SECURE 
)
private

◆ getMediaWikiPermissionsToCheck()

Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::getMediaWikiPermissionsToCheck (   $action,
  $entityType 
)
private

◆ getPageTitleInEntityNamespace()

Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::getPageTitleInEntityNamespace (   $entityType)
private
Parameters
string$entityType
Returns
Title

◆ getPermissionStatus()

Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::getPermissionStatus ( User  $user,
  $permission,
Title  $title,
  $rigor = PermissionManager::RIGOR_SECURE 
)
private

◆ getPermissionStatusForEntity()

Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::getPermissionStatusForEntity ( User  $user,
  $action,
EntityDocument  $entity,
  $rigor = PermissionManager::RIGOR_SECURE 
)
See also
EntityPermissionChecker::getPermissionStatusForEntity
Parameters
User$user
string$action
EntityDocument$entity
string$rigor
Exceptions
InvalidArgumentExceptionif unknown permission is requested
Returns
Status

Implements Wikibase\Repo\Store\EntityPermissionChecker.

◆ getPermissionStatusForEntityId()

Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::getPermissionStatusForEntityId ( User  $user,
  $action,
EntityId  $entityId,
  $rigor = PermissionManager::RIGOR_SECURE 
)
See also
EntityPermissionChecker::getPermissionStatusForEntityId
Parameters
User$user
string$action
EntityId$entityId
string$rigor
Exceptions
InvalidArgumentExceptionif unknown permission is requested
Returns
Status

Implements Wikibase\Repo\Store\EntityPermissionChecker.

◆ getPermissionStatusForEntityType()

Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::getPermissionStatusForEntityType ( User  $user,
array  $actions,
  $type,
  $rigor = PermissionManager::RIGOR_SECURE 
)
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.

Parameters
User$user
string[]$actions
string$type
string$rigorFlag 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
InvalidArgumentExceptionif unknown permission is requested
Returns
Status a status object representing the check's result.

◆ mediawikiPermissionExists()

Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::mediawikiPermissionExists (   $permission)
private

Member Data Documentation

◆ $availableRights

Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::$availableRights
private

◆ $namespaceLookup

Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::$namespaceLookup
private

◆ $permissionManager

Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::$permissionManager
private

◆ $titleLookup

Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::$titleLookup
private

◆ ACTION_MW_CREATE

const Wikibase\Repo\Store\WikiPageEntityStorePermissionChecker::ACTION_MW_CREATE = 'create'

The documentation for this class was generated from the following file: