X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialPreferences.php;h=d541eadcd6b3aa5cd02212def09a16d4f97eecaa;hb=e65f8ac5110804067366f9f239c13f4f29b66c3d;hp=cc7ed5598ba3c23e11a951cb9a1dee02f29a7758;hpb=2b5cd3242845e7c61fd0310e17d2e67d82a1cb7e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index cc7ed5598b..d541eadcd6 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -106,7 +106,7 @@ class SpecialPreferences extends SpecialPage { * Get the preferences form to use. * @param User $user The user. * @param IContextSource $context The context. - * @return PreferencesFormLegacy|HTMLForm + * @return PreferencesFormOOUI|HTMLForm */ protected function getFormObject( $user, IContextSource $context ) { $preferencesFactory = MediaWikiServices::getInstance()->getPreferencesFactory(); @@ -115,7 +115,10 @@ class SpecialPreferences extends SpecialPage { } protected function showResetForm() { - if ( !$this->getUser()->isAllowed( 'editmyoptions' ) ) { + if ( !MediaWikiServices::getInstance() + ->getPermissionManager() + ->userHasRight( $this->getUser(), 'editmyoptions' ) + ) { throw new PermissionsError( 'editmyoptions' ); } @@ -134,7 +137,10 @@ class SpecialPreferences extends SpecialPage { } public function submitReset( $formData ) { - if ( !$this->getUser()->isAllowed( 'editmyoptions' ) ) { + if ( !MediaWikiServices::getInstance() + ->getPermissionManager() + ->userHasRight( $this->getUser(), 'editmyoptions' ) + ) { throw new PermissionsError( 'editmyoptions' ); }