code: public function augmentSQL(SQLQuery &$query) {
  		$stage = Versioned::current_stage();
  		if($stage == 'Live' || !Permission::check("VIEW_DRAFT_CONTENT")) {
  			$query->addWhere("PublishDate < '" . Convert::raw2sql(SS_Datetime::now()) . "'");
  		}
  	}
docs: Augment queries so that we don't fetch unpublished articles.