In this picture , I want to hide the "Crypto sign" button for anonymous users.
I have tried various methods such as
$wgGroupPermissions['*']['mycustomaction'] = false;
according to https://www.mediawiki.org/wiki/Manual:User_rightsgetRestriction
method of my custom action which returns e.g. upload
doesWrites
method of my custom action which returns true
What is the correct way of doing this? I have looked at MediaWiki source code for e.g. DeleteAction.php
, but can't find any clue.
My extension is based on https://github.com/wikimedia/mediawiki-extensions-examples. And my solution is to modify the hooks that adds the action, https://github.com/wikimedia/mediawiki-extensions-examples/blob/f9c26110ca265c9298d436cd79a85935ad148ee1/includes/Hooks.php#L111 to do a permission check:
if ( !$this->permissionManager->userCan( 'edit', $skin->getUser(), $skin->getTitle() ) ) {
return;
}