From 9f214a54f4f3431c95cd622ed73e9dfbb03b29a3 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 23 Jul 2013 13:39:53 +0000
Subject: [PATCH] AciEffectiveRights.java: Changed the signature of createSummary() to return the summary string and remove the srcStr parameter. Extracted methods getEvalReason() and getDecidingAci() from createSummary().

---
 opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java |   50 +++++++++++++++++---------------------------------
 1 files changed, 17 insertions(+), 33 deletions(-)

diff --git a/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java b/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java
index 68c06da..077f333 100644
--- a/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java
+++ b/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java
@@ -128,34 +128,11 @@
    */
   private static void initStatics()
   {
-    if ((aciType = DirectoryServer.getAttributeType("aci")) == null)
-    {
-      aciType = DirectoryServer.getDefaultAttributeType("aci");
-    }
+    aciType = getAttributeType("aci");
+    globalAciType = getAttributeType(ATTR_AUTHZ_GLOBAL_ACI);
+    debugSearchIndex = getAttributeType(EntryContainer.ATTR_DEBUG_SEARCH_INDEX);
+    refAttrType = getAttributeType(ATTR_REFERRAL_URL);
 
-    if ((globalAciType =
-        DirectoryServer.getAttributeType(ATTR_AUTHZ_GLOBAL_ACI)) == null)
-    {
-      globalAciType =
-          DirectoryServer
-              .getDefaultAttributeType(ATTR_AUTHZ_GLOBAL_ACI);
-    }
-
-    if ((debugSearchIndex =
-        DirectoryServer
-            .getAttributeType(EntryContainer.ATTR_DEBUG_SEARCH_INDEX)) == null)
-    {
-      debugSearchIndex =
-          DirectoryServer
-              .getDefaultAttributeType(EntryContainer.ATTR_DEBUG_SEARCH_INDEX);
-    }
-
-    if ((refAttrType =
-        DirectoryServer.getAttributeType(ATTR_REFERRAL_URL)) == null)
-    {
-      refAttrType =
-          DirectoryServer.getDefaultAttributeType(ATTR_REFERRAL_URL);
-    }
     try
     {
       debugSearchIndexDN = DN.decode("cn=debugsearch");
@@ -166,6 +143,16 @@
     }
   }
 
+  private static AttributeType getAttributeType(String name)
+  {
+    AttributeType attrType = DirectoryServer.getAttributeType(name);
+    if (attrType == null)
+    {
+      attrType = DirectoryServer.getDefaultAttributeType(name);
+    }
+    return attrType;
+  }
+
 
 
   /**
@@ -387,11 +374,7 @@
       baseName = toLowerCase(rawAttributeType);
     }
 
-    AttributeType attributeType = DirectoryServer.getAttributeType(baseName);
-    if (attributeType == null)
-    {
-      attributeType = DirectoryServer.getDefaultAttributeType(baseName);
-    }
+    AttributeType attributeType = getAttributeType(baseName);
 
     AttributeValue attributeValue =
         AttributeValues.create(attributeType, operation
@@ -722,7 +705,8 @@
     // Build summary string if doing geteffectiverights eval.
     if (container.isGetEffectiveRightsEval())
     {
-      AciEffectiveRights.createSummary(container, ret, "main");
+      container.setEvalSummary(
+          AciEffectiveRights.createSummary(container, ret));
     }
     return ret;
   }

--
Gitblit v1.10.0