MediaWiki master
MediaWiki\Actions\ActionInfo Class Reference

Provides information about an action that can be used to determine whether the action can be executed in a given context. More...

Public Member Functions

 __construct (array $spec)
 Constructs ActionInfo based on an action object spec which is expected to include the following keys:
 
 getName ()
 
 getRestriction ()
 
 needsReadRights ()
 
 requiresUnblock ()
 
 requiresWrite ()
 

Detailed Description

Provides information about an action that can be used to determine whether the action can be executed in a given context.

Since
1.41
Author
Daniel Kinzler

Definition at line 29 of file ActionInfo.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Actions\ActionInfo::__construct ( array $spec)

Constructs ActionInfo based on an action object spec which is expected to include the following keys:

  • name: the canonical name of the action (string)
  • requiresUnblock: Whether this action can still be executed by a blocked user (bool)
  • requiresWrite: Whether this action requires the wiki not to be locked (bool)
  • needsReadRights: whether this action requires read rights (bool)
  • restriction: the permission required to perform this action (string, or null for none)
Parameters
array$specThe action spec

Definition at line 48 of file ActionInfo.php.

References MediaWiki\Actions\ActionInfo\needsReadRights(), MediaWiki\Actions\ActionInfo\requiresUnblock(), and MediaWiki\Actions\ActionInfo\requiresWrite().

Member Function Documentation

◆ getName()

MediaWiki\Actions\ActionInfo::getName ( )
Returns
string The action's name

Definition at line 59 of file ActionInfo.php.

◆ getRestriction()

MediaWiki\Actions\ActionInfo::getRestriction ( )
Returns
?string A permission required to execute the action

Definition at line 66 of file ActionInfo.php.

◆ needsReadRights()

MediaWiki\Actions\ActionInfo::needsReadRights ( )
Returns
bool Whether the action requires the user to have read access

Definition at line 73 of file ActionInfo.php.

Referenced by MediaWiki\Actions\ActionInfo\__construct().

◆ requiresUnblock()

MediaWiki\Actions\ActionInfo::requiresUnblock ( )
Returns
bool Whether the action requires the user to not be blocked

Definition at line 87 of file ActionInfo.php.

Referenced by MediaWiki\Actions\ActionInfo\__construct().

◆ requiresWrite()

MediaWiki\Actions\ActionInfo::requiresWrite ( )
Returns
bool Whether the action requires the database to be writable

Definition at line 80 of file ActionInfo.php.

Referenced by MediaWiki\Actions\ActionInfo\__construct().


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