MinervaNeue
A responsive mobile first skin
Loading...
Searching...
No Matches
MediaWiki\Minerva\Permissions\MinervaPagePermissions Class Reference

A wrapper for all available Minerva permissions. More...

+ Inheritance diagram for MediaWiki\Minerva\Permissions\MinervaPagePermissions:
+ Collaboration diagram for MediaWiki\Minerva\Permissions\MinervaPagePermissions:

Public Member Functions

 __construct (SkinOptions $skinOptions, LanguagesHelper $languagesHelper, PermissionManager $permissionManager, IContentHandlerFactory $contentHandlerFactory, UserFactory $userFactory, WatchlistManager $watchlistManager)
 Initialize internal Minerva Permissions system.
 
 setContext (IContextSource $context)
 
 isAllowed ( $action)
 Gets whether or not the action is allowed.
 
 isTalkAllowed ()
 @inheritDoc
 

Protected Member Functions

 isCurrentPageContentModelEditable ()
 Checks whether the editor can handle the existing content handler type.
 

Additional Inherited Members

- Public Attributes inherited from MediaWiki\Minerva\Permissions\IMinervaPagePermissions
const WATCHABLE = 'watchable'
 
const WATCH = 'watch'
 
const SWITCH_LANGUAGE = 'switch-language'
 
const CONTENT_EDIT = 'edit'
 Given user permission, the page content is editable.
 
const EDIT_OR_CREATE = 'edit-or-create'
 The existing page is editable or nonexisting page is creatable by the active user.
 
const TALK = 'talk'
 
const HISTORY = 'history'
 
const MOVE = 'move'
 
const DELETE = 'delete'
 
const PROTECT = 'protect'
 

Detailed Description

A wrapper for all available Minerva permissions.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Minerva\Permissions\MinervaPagePermissions::__construct ( SkinOptions $skinOptions,
LanguagesHelper $languagesHelper,
PermissionManager $permissionManager,
IContentHandlerFactory $contentHandlerFactory,
UserFactory $userFactory,
WatchlistManager $watchlistManager )

Initialize internal Minerva Permissions system.

Parameters
SkinOptions$skinOptions
LanguagesHelper$languagesHelper
PermissionManager$permissionManager
IContentHandlerFactory$contentHandlerFactory
UserFactory$userFactory
WatchlistManager$watchlistManager

Member Function Documentation

◆ isAllowed()

MediaWiki\Minerva\Permissions\MinervaPagePermissions::isAllowed ( $action)

Gets whether or not the action is allowed.

Actions isn't allowed when:

  • the user is on the main page

The "edit" action is not allowed if editing is not possible on the page

See also
method isCurrentPageContentModelEditable

The "switch-language" is allowed if there are interlanguage links on the page, or $wgMinervaAlwaysShowLanguageButton is truthy.

@inheritDoc

Exceptions
ConfigException

Implements MediaWiki\Minerva\Permissions\IMinervaPagePermissions.

◆ isCurrentPageContentModelEditable()

MediaWiki\Minerva\Permissions\MinervaPagePermissions::isCurrentPageContentModelEditable ( )
protected

Checks whether the editor can handle the existing content handler type.

Returns
bool

◆ isTalkAllowed()

MediaWiki\Minerva\Permissions\MinervaPagePermissions::isTalkAllowed ( )

◆ setContext()

MediaWiki\Minerva\Permissions\MinervaPagePermissions::setContext ( IContextSource $context)
Parameters
IContextSource$context
Returns
$this

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