From 22094368c2865dcfb6daf8366425212b721a4657 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Thu, 05 Feb 2009 17:42:14 +0000
Subject: [PATCH] Merge ASN1 branch to trunk
---
opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java | 27 +++++++++++++++++++--------
1 files changed, 19 insertions(+), 8 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 d505d25..268290f 100644
--- a/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java
+++ b/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java
@@ -47,9 +47,10 @@
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.protocols.internal.InternalSearchOperation;
+import org.opends.server.protocols.ldap.LDAPControl;
import org.opends.server.types.*;
import org.opends.server.workflowelement.localbackend.*;
-import org.opends.server.controls.GetEffectiveRights;
+import org.opends.server.controls.GetEffectiveRightsRequestControl;
import org.opends.server.backends.jeb.EntryContainer;
@@ -568,7 +569,8 @@
(isAttributeDN(container.getCurrentAttributeType()))) {
String DNString=null;
try {
- DNString = container.getCurrentAttributeValue().getStringValue();
+ DNString =
+ container.getCurrentAttributeValue().getValue().toString();
DN tmpDN = DN.decode(DNString);
//Have a valid DN, compare to clientDN to see if the ACI_SELF
//right should be set.
@@ -911,7 +913,8 @@
DirectoryServer.getAttributeType(baseName)) == null)
attributeType = DirectoryServer.getDefaultAttributeType(baseName);
AttributeValue attributeValue =
- new AttributeValue(attributeType, operation.getAssertionValue());
+ AttributeValues.create(attributeType,
+ operation.getAssertionValue());
operationContainer.setCurrentAttributeType(attributeType);
operationContainer.setCurrentAttributeValue(attributeValue);
return isAllowed(operationContainer, operation);
@@ -1186,12 +1189,20 @@
op.setAttachment(ORIG_AUTH_ENTRY, op.getAuthorizationEntry());
else if(control.getOID().equals(OID_GET_EFFECTIVE_RIGHTS)) {
try {
- GetEffectiveRights getEffectiveRightsControl =
- GetEffectiveRights.decodeControl(control);
+ GetEffectiveRightsRequestControl getEffectiveRightsControl;
+ if(control instanceof LDAPControl)
+ {
+ getEffectiveRightsControl = GetEffectiveRightsRequestControl.DECODER
+ .decode(control.isCritical(), ((LDAPControl) control).getValue());
+ }
+ else
+ {
+ getEffectiveRightsControl = (GetEffectiveRightsRequestControl)control;
+ }
op.setAttachment(OID_GET_EFFECTIVE_RIGHTS, getEffectiveRightsControl);
- } catch (LDAPException le) {
+ } catch (DirectoryException de) {
Message message =
- WARN_ACI_SYNTAX_DECODE_EFFECTIVERIGHTS_FAIL.get(le.getMessage());
+ WARN_ACI_SYNTAX_DECODE_EFFECTIVERIGHTS_FAIL.get(de.getMessage());
logError(message);
ret=false;
}
@@ -1231,7 +1242,7 @@
// Load the values, a bind rule might want to evaluate them.
for (String URLString : URLStrings) {
- builder.add(new AttributeValue(refAttrType, URLString));
+ builder.add(AttributeValues.create(refAttrType, URLString));
}
e.addAttribute(builder.toAttribute(),null);
--
Gitblit v1.10.0