Add user role check up when it's getting dataset profiles for the manager listing

This commit is contained in:
George Kalampokis 2021-07-26 10:28:58 +03:00
parent f01e89799b
commit 6a2099c2b9
1 changed files with 2 additions and 1 deletions

View File

@ -102,7 +102,8 @@ public class DatasetProfileManager {
if (principal.getAuthz().contains(Authorities.ADMIN)) {
authItems = items;
} else if (principal.getAuthz().contains(Authorities.DATASET_PROFILE_MANAGER)) {
authItems = apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().getAuthenticated(items, principal.getId(), null);
List<Integer> roles = Collections.singletonList(1);
authItems = apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().getAuthenticated(items, principal.getId(), roles);
}
QueryableList<DatasetProfile> pagedItems = PaginationManager.applyPaging(authItems, datasetProfileTableRequestItem);
List<DatasetProfileListingModel> datasetProfiles = pagedItems.select(item -> new DatasetProfileListingModel().fromDataModel(item));