}
private String filter(final String role) throws ReportDataFactoryException
{
final Configuration configuration = ClassicEngineBoot.getInstance().getGlobalConfig();
if ("true".equals(configuration.getConfigProperty
("org.pentaho.reporting.engine.classic.extensions.datasources.olap4j.role-filter.enable")) == false)
{
return role;
}
final Iterator staticDenyKeys = configuration.findPropertyKeys
("org.pentaho.reporting.engine.classic.extensions.datasources.olap4j.role-filter.static.deny");
while (staticDenyKeys.hasNext())
{
final String key = (String) staticDenyKeys.next();
final String value = configuration.getConfigProperty(key);
if (ObjectUtilities.equal(value, role))
{
return null;
}
}
final Iterator regExpDenyKeys = configuration.findPropertyKeys
("org.pentaho.reporting.engine.classic.extensions.datasources.olap4j.role-filter.reg-exp.deny");
while (regExpDenyKeys.hasNext())
{
final String key = (String) regExpDenyKeys.next();
final String value = configuration.getConfigProperty(key);
try
{
if (role.matches(value))
{
return null;
}
}
catch (PatternSyntaxException pe)
{
throw new ReportDataFactoryException("Unable to match reg-exp role filter:", pe);
}
}
boolean hasAccept = false;
final Iterator staticAcceptKeys = configuration.findPropertyKeys
("org.pentaho.reporting.engine.classic.extensions.datasources.olap4j.role-filter.static.accept");
while (staticAcceptKeys.hasNext())
{
hasAccept = true;
final String key = (String) staticAcceptKeys.next();
final String value = configuration.getConfigProperty(key);
if (ObjectUtilities.equal(value, role))
{
return role;
}
}
final Iterator regExpAcceptKeys = configuration.findPropertyKeys
("org.pentaho.reporting.engine.classic.extensions.datasources.olap4j.role-filter.reg-exp.accept");
while (regExpAcceptKeys.hasNext())
{
hasAccept = true;
final String key = (String) regExpAcceptKeys.next();
final String value = configuration.getConfigProperty(key);
try
{
if (role.matches(value))
{
return role;