filebackend: use self:: instead of FileBackend:: for some constant uses
[lhc/web/wiklou.git] / includes / ProtectionForm.php
index 4bead34..8b5d995 100644 (file)
@@ -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;