public function restoresnapshot(\SS_HTTPRequest $request)
{
$this->setCurrentActionType(self::ACTION_SNAPSHOT);
/** @var DNDataArchive $dataArchive */
$dataArchive = DNDataArchive::get()->byId($request->param('DataArchiveID'));
if (!$dataArchive) {
throw new SS_HTTPResponse_Exception('Archive not found', 404);
}
// We check for canDownload because that implies access to the data.
// canRestore is later checked on the actual restore action per environment.
if (!$dataArchive->canDownload()) {
throw new SS_HTTPResponse_Exception('Not allowed to access archive', 403);
}
$form = $this->getDataTransferRestoreForm($this->request, $dataArchive);
// View currently only available via ajax
return $form->forTemplate();
}