use of com.thinkbiganalytics.metadata.config.RoleSetExposingSecurityExpressionRoot in project kylo by Teradata.
the class FeedAclIndexQueryAugmentor method generateExistsExpression.
/**
* Generates the Exist expression for the feed to feedacl table
*
* @return exists expression
*/
private static BooleanExpression generateExistsExpression(QOpsManagerFeedId feedId) {
LOG.debug("FeedAclIndexQueryAugmentor.generateExistsExpression(QOpsManagerFeedId)");
RoleSetExposingSecurityExpressionRoot userCxt = getUserContext();
QJpaFeedOpsAclEntry aclEntry = QJpaFeedOpsAclEntry.jpaFeedOpsAclEntry;
JPQLQuery<JpaFeedOpsAclEntry> subquery = JPAExpressions.selectFrom(aclEntry).where(aclEntry.feed.id.eq(feedId).and(aclEntry.principalName.in(userCxt.getGroups()).and(aclEntry.principalType.eq(FeedOpsAclEntry.PrincipalType.GROUP)).or(aclEntry.principalName.eq(userCxt.getName()).and(aclEntry.principalType.eq(FeedOpsAclEntry.PrincipalType.USER)))));
return subquery.exists();
}
use of com.thinkbiganalytics.metadata.config.RoleSetExposingSecurityExpressionRoot in project kylo by Teradata.
the class CacheService method getDashboard.
/**
* We need the Acl List populated in order to do the correct fetch
* Fetch the components of the dashboard in separate threads
*/
public Dashboard getDashboard(FeedHealthSummaryCache.FeedSummaryFilter feedSummaryFilter) {
Dashboard dashboard = null;
if (!accessController.isEntityAccessControlled() || (accessController.isEntityAccessControlled() && feedAclCache.isAvailable())) {
Long time = TimeUtil.getTimeNearestFiveSeconds();
RoleSetExposingSecurityExpressionRoot userContext = feedAclCache.userContext();
DashboardAction dashboardAction = new DashboardAction(time, userContext, feedSummaryFilter);
CyclicBarrier barrier = new CyclicBarrier(5, dashboardAction);
List<ThreadedDashboardTask> tasks = new ArrayList<>();
tasks.add(new ThreadedDashboardTask(barrier, () -> feedHealthSummaryCache.getCache(time)));
tasks.add(new ThreadedDashboardTask(barrier, () -> dataConfidenceJobsCache.getCache(time)));
tasks.add(new ThreadedDashboardTask(barrier, () -> alertsCache.getCache(time)));
tasks.add(new ThreadedDashboardTask(barrier, () -> serviceStatusCache.getCache(time)));
tasks.stream().forEach(t -> executor.submit(t));
try {
barrier.await();
} catch (Exception e) {
}
return dashboardAction.getDashboard();
} else {
return Dashboard.NOT_READY;
}
}
Aggregations