// get the resource we are referring to
Resource resource = m.getResource();
// get the object that will hold the result of scheduled
// requests
ActionMap out = grant.get(resource.getId());
if (out == null) {
out = new ActionMap(resource);
grant.put(resource.getId(), out);
}
// now make the requests
for (Action a : m.values()) {
if (resource.request(identity.getIdentity(), a, registry)) {
out.put(a.getName(), a);
}
}
}
try {
// response now has the proper set of permissions, so create