directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r292630 - /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/RestrictedByFilter.java
Date Fri, 30 Sep 2005 04:41:48 GMT
Author: trustin
Date: Thu Sep 29 21:41:43 2005
New Revision: 292630

URL: http://svn.apache.org/viewcvs?rev=292630&view=rev
Log:
Fixed a bug that RectrictedByFilter is applied to unrelated attributes.

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/RestrictedByFilter.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/RestrictedByFilter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/RestrictedByFilter.java?rev=292630&r1=292629&r2=292630&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/RestrictedByFilter.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/RestrictedByFilter.java
Thu Sep 29 21:41:43 2005
@@ -54,7 +54,7 @@
                 continue;
             }
 
-            if( isRemovable( tuple, attrValue, entry ) )
+            if( isRemovable( tuple, attrId, attrValue, entry ) )
             {
                 i.remove();
             }
@@ -63,7 +63,7 @@
         return tuples;
     }
 
-    public boolean isRemovable( ACITuple tuple, Object attrValue, Attributes entry )
+    public boolean isRemovable( ACITuple tuple, String attrId, Object attrValue, Attributes
entry )
     {
         for( Iterator i = tuple.getProtectedItems().iterator(); i.hasNext(); )
         {
@@ -74,10 +74,13 @@
                 for( Iterator k = rb.iterator(); k.hasNext(); )
                 {
                     RestrictedByItem rbItem = ( RestrictedByItem ) k.next();
-                    Attribute attr = entry.get( rbItem.getValuesIn() );
-                    if( attr == null || !attr.contains( attrValue ) )
+                    if( attrId.equalsIgnoreCase( rbItem.getAttributeType() ) )
                     {
-                        return true;
+                        Attribute attr = entry.get( rbItem.getValuesIn() );
+                        if( attr == null || !attr.contains( attrValue ) )
+                        {
+                            return true;
+                        }
                     }
                 }
             }



Mime
View raw message