From ba663b53d933130d2b6a68c1644e5744428dd1d6 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 25 Nov 2016 11:41:50 +0000
Subject: [PATCH] Manual fixes/changes post inlining DirectoryServer.getSchema()

---
 opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java |   31 +++++++++----------------------
 1 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java
index 0b443c6..76f6d76 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java
@@ -33,6 +33,7 @@
 import org.forgerock.opendj.ldap.RDN;
 import org.forgerock.opendj.ldap.ResultCode;
 import org.forgerock.opendj.ldap.schema.AttributeType;
+import org.forgerock.opendj.ldap.schema.Schema;
 import org.forgerock.opendj.server.config.server.DseeCompatAccessControlHandlerCfg;
 import org.opends.server.api.AccessControlHandler;
 import org.opends.server.api.ClientConnection;
@@ -69,7 +70,6 @@
 import static org.opends.server.core.DirectoryServer.*;
 import static org.opends.server.schema.SchemaConstants.*;
 import static org.opends.server.util.ServerConstants.*;
-import static org.opends.server.util.StaticUtils.*;
 
 /** The AciHandler class performs the main processing for the dseecompat package. */
 public final class AciHandler extends
@@ -123,10 +123,11 @@
    */
   private static void initStatics()
   {
-    aciType = getInstance().getServerContext().getSchema().getAttributeType("aci");
-    globalAciType = getInstance().getServerContext().getSchema().getAttributeType(ATTR_AUTHZ_GLOBAL_ACI);
-    debugSearchIndex = getInstance().getServerContext().getSchema().getAttributeType(SuffixContainer.ATTR_DEBUG_SEARCH_INDEX);
-    refAttrType = getInstance().getServerContext().getSchema().getAttributeType(ATTR_REFERRAL_URL);
+    Schema schema = getInstance().getServerContext().getSchema();
+    aciType = schema.getAttributeType("aci");
+    globalAciType = schema.getAttributeType(ATTR_AUTHZ_GLOBAL_ACI);
+    debugSearchIndex = schema.getAttributeType(SuffixContainer.ATTR_DEBUG_SEARCH_INDEX);
+    refAttrType = schema.getAttributeType(ATTR_REFERRAL_URL);
 
     try
     {
@@ -283,23 +284,9 @@
   @Override
   public boolean isAllowed(LocalBackendCompareOperation operation)
   {
-    AciContainer container =
-        new AciLDAPOperationContainer(operation, ACI_COMPARE);
-
-    String baseName;
-    String rawAttributeType = operation.getRawAttributeType();
-    int semicolonPosition = rawAttributeType.indexOf(';');
-    if (semicolonPosition > 0)
-    {
-      baseName =
-          toLowerCase(rawAttributeType.substring(0, semicolonPosition));
-    }
-    else
-    {
-      baseName = toLowerCase(rawAttributeType);
-    }
-
-    container.setCurrentAttributeType(getInstance().getServerContext().getSchema().getAttributeType(baseName));
+    AciContainer container = new AciLDAPOperationContainer(operation, ACI_COMPARE);
+    AttributeDescription attrDesc = AttributeDescription.valueOf(operation.getRawAttributeType());
+    container.setCurrentAttributeType(attrDesc.getAttributeType());
     container.setCurrentAttributeValue(operation.getAssertionValue());
     return isAllowed(container, operation);
   }

--
Gitblit v1.10.0