use of com.thinkbiganalytics.metadata.jpa.feed.security.QJpaFeedOpsAclEntry 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();
}
Aggregations