}
// For search operations:
if (operation.getOperationType().equals(OperationType.SEARCH))
{
PreParseSearchOperation searchOp =
(PreParseSearchOperation) operation;
// Check the allowed/prohibited attributes in search filter
if (!prohibitedAttributes.isEmpty())
{
// The attributes specified in prohibitedAttributes are not OK
allowRequest =
!containsProhibitedAttribute(searchOp.getRawFilter());
}
if (!allowRequest)
{
statistics.updateRejectedAttributes();
messages.add(INFO_ERROR_ATTRIBUTE_NOT_ALLOWED.get());
return allowRequest;
}
if (!allowedAttributes.isEmpty())
{
// Only the attributes specified in allowedAttributes are OK
allowRequest =
containsOnlyAllowedAttributes(searchOp.getRawFilter());
}
if (!allowRequest)
{
statistics.updateRejectedAttributes();
messages.add(INFO_ERROR_ATTRIBUTE_NOT_ALLOWED.get());
return allowRequest;
}
// Check the search scope
if (!allowedSearchScopes.isEmpty())
{
switch (searchOp.getScope())
{
case BASE_OBJECT:
allowRequest =
allowedSearchScopes.contains(AllowedSearchScopes.BASE);
break;