use of com.emc.storageos.db.client.constraint.ContainmentPermissionsConstraint in project coprhd-controller by CoprHD.
the class BourneDbClient method findByPermission.
public <T extends DataObjectWithACLs> Map<URI, Set<String>> findByPermission(Class<T> type, PermissionsKey key, final Set<String> filterBy) throws DataAccessException {
if (key == null || type == null) {
return Maps.newHashMap();
}
PermissionMapQueryResultList queryResults = new PermissionMapQueryResultList(filterBy);
ContainmentPermissionsConstraint constraint = ContainmentPermissionsConstraint.Factory.getObjsWithPermissionsConstraint(key.toString(), type);
try {
getDbClient().queryByConstraint(constraint, queryResults);
} catch (DatabaseException e) {
throw new DataAccessException(e);
}
// loops over results and loads into permissionMap
for (Iterator<URI> iterator = queryResults.iterator(); iterator.hasNext(); iterator.next()) {
// Do nothing
}
return queryResults.getPermissionMap();
}
Aggregations