X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FProtectionForm.php;h=8b5d9956abd444bd7b0619c54247d3f17b9fcd0f;hb=4b7cbbd9980f5ff14a0066ae7992af2793dcabea;hp=4bead3464c52e3f0a81cb9953e281f54657f315c;hpb=7388b7b62b842ef1e80faa677656a26a90803ece;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 4bead3464c..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() ) === [ '' ] ) { @@ -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;