25 'revisiondelete' => SpecialPageAction::class,
27 'access' =>
'ControlledAccessDummyAction',
28 'unblock' =>
'RequiresUnblockDummyAction',
29 'string' =>
'NamedDummyAction',
30 'declared' =>
'NonExistingClassName',
31 'callable' => [ $this,
'dummyActionCallback' ],
37 return WikiPage::factory( Title::makeTitle( 0,
'Title' ) );
52 [
'dummy',
'DummyAction' ],
53 [
'string',
'NamedDummyAction' ],
54 [
'callable',
'CalledDummyAction' ],
55 [
'object',
'InstantiatedDummyAction' ],
58 [
'DUMMY',
'DummyAction' ],
59 [
'STRING',
'NamedDummyAction' ],
63 [
'undeclared',
null ],
75 $exists = Action::exists( $requestedAction );
77 $this->
assertSame( $expected !==
null, $exists );
82 $exists = Action::exists(
'declared' );
94 $actionName = Action::getActionName(
$context );
102 $actionName = Action::getActionName(
$context );
110 $actionName = Action::getActionName(
$context );
118 $context->getRequest()->setVal(
'revisiondelete',
true );
119 $actionName = Action::getActionName(
$context );
128 $actionName = Action::getActionName(
$context );
140 $action = Action::factory( $requestedAction,
$context->getWikiPage(),
$context );
142 $this->
assertType( $expected ?:
'null', $action );
146 $exists = Action::exists(
null );
153 $actionName = Action::getActionName(
$context );
160 $action = Action::factory(
null, $page );
166 $exists = Action::exists(
'disabled' );
173 $actionName = Action::getActionName(
$context );
180 $action = Action::factory(
'disabled', $page );
192 $user->mRights = [
'access' ];
194 $this->
assertNull( $action->canExecute( $user ) );
203 $action->canExecute( $user );
204 }
catch ( Exception
$e ) {
214 $action = Action::factory(
'unblock', $page, $this->
getContext() );
216 $block =
new Block( [
219 'expiry' =>
'infinity',
222 $block->setRestrictions( [
229 $action->canExecute( $user );
230 }
catch ( Exception
$e ) {
242 return static::class;
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
testActionExists_doesNotRequireInstantiation()
testDisabledAction_exists()
testGetActionName_revisiondeleteWorkaround()
testGetActionName( $requestedAction, $expected)
actionProvider
testCanExecuteRequiresUnblock()
testGetActionName_editredlinkWorkaround()
testGetActionName_whenCanNotUseWikiPage_defaultsToView()
testDisabledAction_factoryReturnsFalse()
testActionFactory( $requestedAction, $expected)
actionProvider
testGetActionName_historysubmitWorkaround()
getContext( $requestedAction=null)
testNull_defaultsToView()
testDisabledAction_isNotResolved()
testActionExists( $requestedAction, $expected)
actionProvider
testNull_canNotBeInstantiated()
Actions are things which can be done to pages (edit, delete, rollback, etc).
checkCanExecute(User $user)
Checks if the given user (identified by an object) can perform this action.
getRestriction()
Get the permission required to perform this action.
An IContextSource implementation which will inherit context from another source but allow individual ...
getName()
Return the name of the action this object responds to.
show()
The main action entry point.
WebRequest clone which takes values from a provided array.
requiresUnblock()
Whether this action can still be executed by a blocked user.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
returning false will NOT prevent logging $e