manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1175120 - /incubator/lcf/upstream/solr/SOLR-1895/solr/contrib/mcf/src/java/org/apache/solr/mcf/ManifoldCFSecurityFilter.java
Date Sat, 24 Sep 2011 07:38:10 GMT
Author: kwright
Date: Sat Sep 24 07:38:10 2011
New Revision: 1175120

URL: http://svn.apache.org/viewvc?rev=1175120&view=rev
Log:
Simplify the filters

Modified:
    incubator/lcf/upstream/solr/SOLR-1895/solr/contrib/mcf/src/java/org/apache/solr/mcf/ManifoldCFSecurityFilter.java

Modified: incubator/lcf/upstream/solr/SOLR-1895/solr/contrib/mcf/src/java/org/apache/solr/mcf/ManifoldCFSecurityFilter.java
URL: http://svn.apache.org/viewvc/incubator/lcf/upstream/solr/SOLR-1895/solr/contrib/mcf/src/java/org/apache/solr/mcf/ManifoldCFSecurityFilter.java?rev=1175120&r1=1175119&r2=1175120&view=diff
==============================================================================
--- incubator/lcf/upstream/solr/SOLR-1895/solr/contrib/mcf/src/java/org/apache/solr/mcf/ManifoldCFSecurityFilter.java
(original)
+++ incubator/lcf/upstream/solr/SOLR-1895/solr/contrib/mcf/src/java/org/apache/solr/mcf/ManifoldCFSecurityFilter.java
Sat Sep 24 07:38:10 2011
@@ -198,22 +198,20 @@ public class ManifoldCFSecurityFilter ex
     BooleanFilter bf = new BooleanFilter();
     
     // Add a clause for each token.  This will be added directly to the main filter (as a
deny test), as well as to an OR's subclause (as an allow test).
-    BooleanFilter orFilter = new BooleanFilter();
     // Add the empty-acl case
     BooleanFilter subUnprotectedClause = new BooleanFilter();
     subUnprotectedClause.add(new FilterClause(new QueryWrapperFilter(new WildcardQuery(new
Term(allowField,"*"))),BooleanClause.Occur.MUST_NOT));
     subUnprotectedClause.add(new FilterClause(new QueryWrapperFilter(new WildcardQuery(new
Term(denyField,"*"))),BooleanClause.Occur.MUST_NOT));
-    orFilter.add(new FilterClause(subUnprotectedClause,BooleanClause.Occur.SHOULD));
+    bf.add(new FilterClause(subUnprotectedClause,BooleanClause.Occur.SHOULD));
     for (String accessToken : userAccessTokens)
     {
       TermsFilter tf = new TermsFilter();
       tf.addTerm(new Term(allowField,accessToken));
-      orFilter.add(new FilterClause(tf,BooleanClause.Occur.SHOULD));
+      bf.add(new FilterClause(tf,BooleanClause.Occur.SHOULD));
       tf = new TermsFilter();
       tf.addTerm(new Term(denyField,accessToken));
       bf.add(new FilterClause(tf,BooleanClause.Occur.MUST_NOT));
     }
-    bf.add(new FilterClause(orFilter,BooleanClause.Occur.MUST));
     return bf;
   }
   



Mime
View raw message