* 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();
}
protected function showResetForm() {
- if ( !$this->getUser()->isAllowed( 'editmyoptions' ) ) {
+ if ( !MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasRight( $this->getUser(), 'editmyoptions' )
+ ) {
throw new PermissionsError( 'editmyoptions' );
}
}
public function submitReset( $formData ) {
- if ( !$this->getUser()->isAllowed( 'editmyoptions' ) ) {
+ if ( !MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasRight( $this->getUser(), 'editmyoptions' )
+ ) {
throw new PermissionsError( 'editmyoptions' );
}