X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FProtectionForm.php;h=8b5d9956abd444bd7b0619c54247d3f17b9fcd0f;hb=d9eec3c9124d87fd44e6917d5b1512b78352afb3;hp=2f1059886d4378c9133b1f16704f8c75b6948c62;hpb=f79c9e6ca3c02090d6d56eaecb2ab90d4198b2b9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 2f1059886d..8b5d9956ab 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -90,7 +90,7 @@ class ProtectionForm { * Loads the current state of protection into the object. */ function loadData() { - $levels = MediaWikiServices::getInstance()->getNamespaceInfo()->getRestrictionLevels( + $levels = MediaWikiServices::getInstance()->getPermissionManager()->getNamespaceRestrictionLevels( $this->mTitle->getNamespace(), $this->mContext->getUser() ); $this->mCascade = $this->mTitle->areRestrictionsCascading(); @@ -180,7 +180,7 @@ class ProtectionForm { */ function execute() { if ( - MediaWikiServices::getInstance()->getNamespaceInfo()->getRestrictionLevels( + MediaWikiServices::getInstance()->getPermissionManager()->getNamespaceRestrictionLevels( $this->mTitle->getNamespace() ) === [ '' ] ) { @@ -200,7 +200,7 @@ class ProtectionForm { /** * Show the input form with optional error message * - * @param string|null $err Error message or null if there's no error + * @param string|string[]|null $err Error message or null if there's no error */ function show( $err = null ) { $out = $this->mContext->getOutput(); @@ -553,7 +553,8 @@ class ProtectionForm { } $out .= Xml::closeElement( 'fieldset' ); - if ( $user->isAllowed( 'editinterface' ) ) { + if ( MediaWikiServices::getInstance()->getPermissionManager() + ->userHasRight( $user, 'editinterface' ) ) { $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); $link = $linkRenderer->makeKnownLink( $context->msg( 'protect-dropdown' )->inContentLanguage()->getTitle(), @@ -585,10 +586,12 @@ class ProtectionForm { function buildSelector( $action, $selected ) { // If the form is disabled, display all relevant levels. Otherwise, // just show the ones this user can use. - $levels = MediaWikiServices::getInstance()->getNamespaceInfo()->getRestrictionLevels( - $this->mTitle->getNamespace(), - $this->disabled ? null : $this->mContext->getUser() - ); + $levels = MediaWikiServices::getInstance() + ->getPermissionManager() + ->getNamespaceRestrictionLevels( + $this->mTitle->getNamespace(), + $this->disabled ? null : $this->mContext->getUser() + ); $id = 'mwProtect-level-' . $action;