StoreInfo store = resource.getStore();
WorkspaceInfo ws = store.getWorkspace();
String workspace = ws.getName();
// get the request infos
RuleFilter ruleFilter = new RuleFilter(RuleFilter.SpecialFilterType.ANY);
setRuleFilterUserOrRole(user, ruleFilter);
ruleFilter.setInstance(configurationManager.getConfiguration().getInstanceName());
if (service != null)
{
if ("*".equals(service))
{
ruleFilter.setService(RuleFilter.SpecialFilterType.ANY);
}
else
{
ruleFilter.setService(service);
}
} else {
ruleFilter.setService(RuleFilter.SpecialFilterType.DEFAULT);
}
if (request != null)
{
if ("*".equals(request))
{
ruleFilter.setRequest(RuleFilter.SpecialFilterType.ANY);
}
else
{
ruleFilter.setRequest(request);
}
} else {
ruleFilter.setRequest(RuleFilter.SpecialFilterType.DEFAULT);
}
ruleFilter.setWorkspace(workspace);
ruleFilter.setLayer(layer);
String sourceAddress = retrieveCallerIpAddress();
if(sourceAddress != null) {
ruleFilter.setSourceAddress(sourceAddress);
} else {
LOGGER.log(Level.WARNING, "No source IP address found");
ruleFilter.setSourceAddress(RuleFilter.SpecialFilterType.DEFAULT);
}
LOGGER.log(Level.FINE, "ResourceInfo filter: {0}", ruleFilter);
AccessInfo rule = rules.getAccessInfo(ruleFilter);