}
return permissionRecords;
}
protected RoleCriteria getFetchCriteria(DSRequest request) {
RoleCriteria criteria = new RoleCriteria();
// Filtering
Integer id = getFilter(request, Field.ID, Integer.class);
criteria.addFilterId(id);
Integer subjectId = getFilter(request, CriteriaField.SUBJECT_ID, Integer.class);
if (subjectId != null) {
criteria.addFilterSubjectId(subjectId);
}
// Fetching
criteria.fetchPermissions(true);
if (id != null) {
// If we're fetching a single Role, then fetch all the related Sets.
criteria.fetchSubjects(true);
criteria.fetchResourceGroups(true);
criteria.fetchLdapGroups(true);
criteria.fetchBundleGroups(true);
}
// TODO: instead of fetching subjects and resource groups, use a composite object that will pull the subject
// and resource group count across the wire. these counts will not required permission checks at all.