You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by tr...@apache.org on 2005/09/30 10:52:13 UTC

svn commit: r292679 - /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/RelatedProtectedItemFilter.java

Author: trustin
Date: Fri Sep 30 01:52:10 2005
New Revision: 292679

URL: http://svn.apache.org/viewcvs?rev=292679&view=rev
Log:
Fixed that ProtectedItem.SelfValue is not evaluated correctly.

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

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/RelatedProtectedItemFilter.java?rev=292679&r1=292678&r2=292679&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/RelatedProtectedItemFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/RelatedProtectedItemFilter.java Fri Sep 30 01:52:10 2005
@@ -218,7 +218,7 @@
             }
             else if( item instanceof ProtectedItem.SelfValue )
             {
-                if( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE ||
+                if( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE &&
                     scope != OperationScope.ATTRIBUTE_TYPE )
                 {
                     continue;
@@ -227,10 +227,14 @@
                 ProtectedItem.SelfValue sv = ( ProtectedItem.SelfValue ) item;
                 for( Iterator j = sv.iterator(); j.hasNext(); )
                 {
-                    Attribute attr = entry.get( String.valueOf( j.next() ) );
-                    if( attr.contains( userName ) || attr.contains( userName.toString() ) )
+                    String svItem = String.valueOf( j.next() );
+                    if( svItem.equalsIgnoreCase( attrId ) )
                     {
-                        return true;
+                        Attribute attr = entry.get( attrId );
+                        if( attr != null && ( attr.contains( userName ) || attr.contains( userName.toString() ) ) )
+                        {
+                            return true;
+                        }
                     }
                 }
             }