+ // Check that the user is allowed to carry out the deletion
+ $errors = $titleObj->getUserPermissionsErrors( 'delete', $user );
+ if ( count( $errors ) ) {
+ $this->dieUsageMsg( $errors[0] );
+ }
+
+ // If change tagging was requested, check that the user is allowed to tag,
+ // and the tags are valid
+ if ( count( $params['tags'] ) ) {
+ $tagStatus = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $user );
+ if ( !$tagStatus->isOK() ) {
+ $this->dieStatus( $tagStatus );
+ }
+ }
+