code: public function canSubmitReview($record)
      {
          if (!$record->canEdit()
              || !$record->hasMethod('canBeReviewedBy')
              || !$record->canBeReviewedBy(Security::getCurrentUser())
          ) {
              return false;
          }
          return true;
      }
docs: Determine whether the user can submit a review
  
  @param DataObject $record
  @return bool