* 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();
*/
function execute() {
if (
- MediaWikiServices::getInstance()->getNamespaceInfo()->getRestrictionLevels(
+ MediaWikiServices::getInstance()->getPermissionManager()->getNamespaceRestrictionLevels(
$this->mTitle->getNamespace()
) === [ '' ]
) {
}
$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(),
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;