use of org.obiba.mica.dataset.domain.StudyDataset in project mica2 by obiba.
the class DatasetController method getDataset.
private Dataset getDataset(String id, String shareKey) {
Dataset dataset;
if (Strings.isNullOrEmpty(shareKey)) {
dataset = publishedDatasetService.findById(id);
if (dataset == null)
throw NoSuchDatasetException.withId(id);
checkAccess((dataset instanceof StudyDataset) ? "/collected-dataset" : "/harmonized-dataset", id);
} else {
try {
dataset = draftCollectedDatasetService.findById(id);
checkPermission("/draft/collected-dataset", "VIEW", id, shareKey);
} catch (NoSuchDatasetException ex) {
dataset = draftHarmonizedDatasetService.findById(id);
checkPermission("/draft/harmonized-dataset", "VIEW", id, shareKey);
}
}
return dataset;
}
use of org.obiba.mica.dataset.domain.StudyDataset in project mica2 by obiba.
the class DatasetAnalysisController method getDataset.
private Dataset getDataset(String id) {
Dataset dataset = publishedDatasetService.findById(id);
if (dataset == null)
throw NoSuchDatasetException.withId(id);
checkAccess((dataset instanceof StudyDataset) ? "/collected-dataset" : "/harmonized-dataset", id);
return dataset;
}
Aggregations