use of org.zalando.nakadi.domain.AllDataAccessResource in project nakadi by zalando.
the class AdminService method hasAllDataAccess.
public boolean hasAllDataAccess(final AuthorizationService.Operation operation) {
try {
final List<Permission> permissions = resourceCache.get(ALL_DATA_ACCESS_RESOURCE, () -> authorizationDbRepository.listAllDataAccess());
final Resource resource = new AllDataAccessResource(ALL_DATA_ACCESS_RESOURCE, ResourceAuthorization.fromPermissionsList(permissions));
return authorizationService.isAuthorized(operation, resource);
} catch (ExecutionException e) {
LOG.error("Could not determine whether this application has all data access", e);
return false;
}
}
Aggregations