+ " ( SELECT count(p) FROM %alias%.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s.id = %subjectId% AND p = 16 ))"; // MANAGE_DRIFT
compositeProjection = compositeProjection.replace("%subjectId%", String.valueOf(subject.getId()));
}
compositeProjection = compositeProjection.replace("%alias%", criteria.getAlias());
CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria);
generator.alterProjection(compositeProjection);
if (isInventoryManager == false) {
if (criteria.isInventoryManagerRequired()) {
throw new PermissionException("Subject [" + subject.getName()
+ "] requires InventoryManager permission for requested query criteria.");
}
generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE, null,
subject.getId());
}
CriteriaQueryRunner<ResourceComposite> queryRunner = new CriteriaQueryRunner<ResourceComposite>(criteria,
generator, entityManager, false); // don't auto-init bags, we're returning composites not entities