$user = $this->getUser();
$this->checkUserRightsAny( RevisionDeleter::getRestriction( $params['type'] ) );
- if ( $user->isBlocked() ) {
- $this->dieBlocked( $user->getBlock() );
- }
-
if ( !$params['ids'] ) {
$this->dieWithError( [ 'apierror-paramempty', 'ids' ], 'paramempty_ids' );
}
$this->dieWithError( [ 'apierror-revdel-needtarget' ], 'needtarget' );
}
+ if ( $this->getPermissionManager()->isBlockedFrom( $user, $targetObj ) ) {
+ $this->dieBlocked( $user->getBlock() );
+ }
+
$list = RevisionDeleter::createList(
$params['type'], $this->getContext(), $targetObj, $params['ids']
);
}
$list->reloadFromMaster();
- // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $item = $list->reset(); $list->current(); $item = $list->next() ) {
$data['items'][$item->getId()] += $item->getApiData( $this->getResult() );
}