final AccessRequired.To arTo = f.getAnnotation(AccessRequired.To.class);
if (arTo != null) {
isAnnotated = true;
final String resourceNameForField = resourceNameFromField(f, command);
for (final String access : arTo.value()) {
final AccessCheck a = new AccessCheck(resourceNameForField, access);
String tag = null;
if (isTaggable) {
tag = " @AccessRequired.To on field " + f.getDeclaringClass().getName() + "#" + f.getName();
}
accessChecks.add(new AccessCheckWork(a, tag));
}
}
final AccessRequired.NewChild arNC = f.getAnnotation(AccessRequired.NewChild.class);
if (arNC != null) {
isAnnotated = true;
String resourceNameForField = resourceNameFromNewChildAnno(arNC, f, command);
/*
* We have the resource name for the parent. Compute the rest of
* the resource name using the explicit collection name in the
* anno or the inferred name from the child type.
*/
for (final String action : arNC.action()) {
final AccessCheck a = new AccessCheck(resourceNameForField, action);
String tag = null;
if (isTaggable) {
tag = " @AccessRequired.NewChild on field " + f.getDeclaringClass().getName() + "#" + f.getName();
}
accessChecks.add(new AccessCheckWork(a, tag));