directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r292679 - /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/RelatedProtectedItemFilter.java
Date Fri, 30 Sep 2005 08:52:13 GMT
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;
+                        }
                     }
                 }
             }



Mime
View raw message