use of ddf.catalog.plugin.impl.PolicyResponseImpl in project ddf by codice.
the class RegistryPolicyPlugin method processPostQuery.
@Override
public PolicyResponse processPostQuery(Result input, Map<String, Serializable> properties) throws StopProcessingException {
HashMap<String, Set<String>> itemPolicy = new HashMap<>();
Metacard metacard = input.getMetacard();
if (RegistryUtility.isRegistryMetacard(metacard) || RegistryUtility.isInternalRegistryMetacard(metacard)) {
if ((whiteList && !registryEntryIds.contains(metacard.getId())) || (!whiteList && registryEntryIds.contains(metacard.getId()))) {
itemPolicy.putAll(bypassAccessPolicy);
} else {
itemPolicy.putAll(readAccessPolicy);
}
}
return new PolicyResponseImpl(new HashMap<>(), itemPolicy);
}
Aggregations