&& !RepoGroup::singleton()->getLocalRepo()->findFile( $toTitle )
&& MediaWikiServices::getInstance()->getRepoGroup()->findFile( $toTitle )
) {
- if ( !$params['ignorewarnings'] && $user->isAllowed( 'reupload-shared' ) ) {
+ if ( !$params['ignorewarnings'] &&
+ $this->getPermissionManager()->userHasRight( $user, 'reupload-shared' ) ) {
$this->dieWithError( 'apierror-fileexists-sharedrepo-perm' );
- } elseif ( !$user->isAllowed( 'reupload-shared' ) ) {
+ } elseif ( !$this->getPermissionManager()->userHasRight( $user, 'reupload-shared' ) ) {
$this->dieWithError( 'apierror-cantoverwrite-sharedfile' );
}
}
}
// Check suppressredirect permission
- if ( !$user->isAllowed( 'suppressredirect' ) ) {
+ if ( !$this->getPermissionManager()->userHasRight( $user, 'suppressredirect' ) ) {
$createRedirect = true;
}