[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtendedSearch[master]: BSWikiAdmin: Admin menu - individual module permission check
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/377788 ) Change subject: BSWikiAdmin: Admin menu - individual module permission check .. BSWikiAdmin: Admin menu - individual module permission check * Added individual permission checks to the extensions that make use of the hook BSWikiAdminMenuItems to register non WikiAdminModule links to the menu => Requires https://gerrit.wikimedia.org/r/#/c/377786/ => part of #7401 Change-Id: Ifff5629df315f3ffc3f01b55ecf9b9e9a4385b2f --- M src/Setup.php 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Robert Vogel: Looks good to me, approved jenkins-bot: Verified diff --git a/src/Setup.php b/src/Setup.php index 6c2f155..75ffd70 100644 --- a/src/Setup.php +++ b/src/Setup.php @@ -42,9 +42,13 @@ /** * Adds link to admin panel * @param array $aOutSortable +* @param \User The user in which context the menu is rendered * @return boolean always true to keep hook running */ - public static function onBSWikiAdminMenuItems( &$aOutSortable ) { + public static function onBSWikiAdminMenuItems( &$aOutSortable, $oUser ) { + if( !$oUser->isAllowed( 'extendedsearchadmin-viewspecialpage' ) ) { + return true; + } $oSpecialPage = \SpecialPage::getTitleFor( 'BSSearchAdmin' ); $sLink = \Html::element( 'a', -- To view, visit https://gerrit.wikimedia.org/r/377788 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifff5629df315f3ffc3f01b55ecf9b9e9a4385b2f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/BlueSpiceExtendedSearch Gerrit-Branch: master Gerrit-Owner: PwirthGerrit-Reviewer: Ljonka Gerrit-Reviewer: Mglaser Gerrit-Reviewer: Robert Vogel Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtendedSearch[master]: BSWikiAdmin: Admin menu - individual module permission check
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/377788 ) Change subject: BSWikiAdmin: Admin menu - individual module permission check .. BSWikiAdmin: Admin menu - individual module permission check * Added individual permission checks to the extensions that make use of the hook BSWikiAdminMenuItems to register non WikiAdminModule links to the menu => Soft requires https://gerrit.wikimedia.org/r/#/c/377786/ => part of #7401 Change-Id: Ifff5629df315f3ffc3f01b55ecf9b9e9a4385b2f --- M src/Setup.php 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtendedSearch refs/changes/88/377788/1 diff --git a/src/Setup.php b/src/Setup.php index 6c2f155..75ffd70 100644 --- a/src/Setup.php +++ b/src/Setup.php @@ -42,9 +42,13 @@ /** * Adds link to admin panel * @param array $aOutSortable +* @param \User The user in which context the menu is rendered * @return boolean always true to keep hook running */ - public static function onBSWikiAdminMenuItems( &$aOutSortable ) { + public static function onBSWikiAdminMenuItems( &$aOutSortable, $oUser ) { + if( !$oUser->isAllowed( 'extendedsearchadmin-viewspecialpage' ) ) { + return true; + } $oSpecialPage = \SpecialPage::getTitleFor( 'BSSearchAdmin' ); $sLink = \Html::element( 'a', -- To view, visit https://gerrit.wikimedia.org/r/377788 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifff5629df315f3ffc3f01b55ecf9b9e9a4385b2f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtendedSearch Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits