directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r808202 - in /directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz: AciAuthorizationInterceptor.java support/RelatedProtectedItemFilter.java
Date Wed, 26 Aug 2009 22:06:25 GMT
Author: elecharny
Date: Wed Aug 26 22:06:24 2009
New Revision: 808202

URL: http://svn.apache.org/viewvc?rev=808202&view=rev
Log:
Fixed various compilation errors

Modified:
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=808202&r1=808201&r2=808202&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
Wed Aug 26 22:06:24 2009
@@ -77,6 +77,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
 import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.slf4j.Logger;
@@ -172,6 +173,9 @@
     /** attribute type registry */
     private AttributeTypeRegistry atRegistry;
     
+    /** ObjectClass registry */
+    private ObjectClassRegistry ocRegistry;
+    
     /** whether or not this interceptor is activated */
     private boolean enabled;
     
@@ -211,12 +215,13 @@
         groupCache = new GroupCache( adminSession );
         registries = directoryService.getRegistries();
         atRegistry = registries.getAttributeTypeRegistry();
+        ocRegistry = registries.getObjectClassRegistry();
         OidRegistry oidRegistry = registries.getOidRegistry();
         
         // look up some constant information
-        String objectClassOid = oidRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT );
-        subentryOid = oidRegistry.getOid( SchemaConstants.SUBENTRY_OC );
-        String acSubentryOid = oidRegistry.getOid( AC_SUBENTRY_ATTR );
+        String objectClassOid = atRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT );
+        subentryOid = ocRegistry.getOid( SchemaConstants.SUBENTRY_OC );
+        String acSubentryOid = atRegistry.getOid( AC_SUBENTRY_ATTR );
         objectClassType = atRegistry.lookup( objectClassOid );
         acSubentryType = atRegistry.lookup( acSubentryOid );
         entryAciType = atRegistry.lookup( SchemaConstants.ENTRY_ACI_AT_OID ); 

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java?rev=808202&r1=808201&r2=808202&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
Wed Aug 26 22:06:24 2009
@@ -58,8 +58,7 @@
 {
     private final RefinementEvaluator refinementEvaluator;
     private final Evaluator entryEvaluator;
-    private final OidRegistry oidRegistry;
-    private final AttributeTypeRegistry attrRegistry;
+    private final AttributeTypeRegistry atRegistry;
 
 
     public RelatedProtectedItemFilter( RefinementEvaluator refinementEvaluator, Evaluator
entryEvaluator, 
@@ -67,8 +66,7 @@
     {
         this.refinementEvaluator = refinementEvaluator;
         this.entryEvaluator = entryEvaluator;
-        this.oidRegistry = oidRegistry;
-        this.attrRegistry = attrRegistry;
+        this.atRegistry = attrRegistry;
     }
 
 
@@ -115,7 +113,7 @@
         
         if ( attrId != null )
         {
-            oid = oidRegistry.getOid( attrId );
+            oid = atRegistry.getOid( attrId );
         }
         
         for ( ProtectedItem item : tuple.getProtectedItems() )
@@ -153,9 +151,10 @@
                 }
 
                 ProtectedItem.AllAttributeValues aav = ( ProtectedItem.AllAttributeValues
) item;
+
                 for ( Iterator<String> j = aav.iterator(); j.hasNext(); )
                 {
-                    if ( oid.equals( oidRegistry.getOid( j.next() ) ) )
+                    if ( oid.equals( atRegistry.getOid( j.next() ) ) )
                     {
                         return true;
                     }
@@ -169,9 +168,10 @@
                 }
 
                 ProtectedItem.AttributeType at = ( ProtectedItem.AttributeType ) item;
+                
                 for ( Iterator<String> j = at.iterator(); j.hasNext(); )
                 {
-                    if ( oid.equals( oidRegistry.getOid( j.next() ) ) )
+                    if ( oid.equals( atRegistry.getOid( j.next() ) ) )
                     {
                         return true;
                     }
@@ -188,8 +188,8 @@
                 for ( Iterator<Attribute> j = av.iterator(); j.hasNext(); )
                 {
                     Attribute attr = j.next();
-                    String attrOid = oidRegistry.getOid( attr.getID() );
-                    AttributeType attrType = attrRegistry.lookup( attrOid );
+                    String attrOid = atRegistry.getOid( attr.getID() );
+                    AttributeType attrType = atRegistry.lookup( attrOid );
                     
                     if ( oid.equals( attrOid ) && AttributeUtils.containsValue( attr,
attrValue, attrType ) )
                     {
@@ -220,7 +220,8 @@
                 for ( Iterator<MaxValueCountItem> j = mvc.iterator(); j.hasNext();
)
                 {
                     MaxValueCountItem mvcItem = j.next();
-                    if ( oid.equals( oidRegistry.getOid( mvcItem.getAttributeType() ) ) )
+                    
+                    if ( oid.equals( atRegistry.getOid( mvcItem.getAttributeType() ) ) )
                     {
                         return true;
                     }
@@ -246,7 +247,7 @@
                 for ( Iterator<RestrictedByItem> j = rb.iterator(); j.hasNext(); )
                 {
                     RestrictedByItem rbItem = j.next();
-                    if ( oid.equals( oidRegistry.getOid( rbItem.getAttributeType() ) ) )
+                    if ( oid.equals( atRegistry.getOid( rbItem.getAttributeType() ) ) )
                     {
                         return true;
                     }
@@ -263,7 +264,8 @@
                 for ( Iterator<String> j = sv.iterator(); j.hasNext(); )
                 {
                     String svItem = j.next();
-                    if ( oid.equals( oidRegistry.getOid( svItem ) ) )
+                    
+                    if ( oid.equals( atRegistry.getOid( svItem ) ) )
                     {
                         EntryAttribute attr = entry.get( oid );
                         



Mime
View raw message