From 507e00fb190713b1654579123d284bcd3d750abe Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Wed, 10 Apr 2013 10:31:19 +0000
Subject: [PATCH] Partial fix for OPENDJ-693: Implement modify/update support
---
opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java b/opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java
index 50e5472..680797e 100644
--- a/opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java
+++ b/opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java
@@ -16,6 +16,7 @@
package org.forgerock.opendj.rest2ldap;
+import static org.forgerock.opendj.rest2ldap.Utils.i18n;
import static org.forgerock.opendj.rest2ldap.Utils.isJSONPrimitive;
import java.util.ArrayList;
@@ -53,8 +54,8 @@
DN.valueOf(authzId.substring(3), schema);
} catch (final IllegalArgumentException e) {
throw new ForbiddenException(
- "The request could not be authorized because the required security principal "
- + " was not a valid LDAP DN");
+ i18n("The request could not be authorized because the required "
+ + "security principal was not a valid LDAP DN"));
}
return authzId;
}
@@ -135,15 +136,13 @@
if (isJSONPrimitive(value)) {
values[i] = String.valueOf(value);
} else if (value == null) {
- // FIXME: i18n.
- throw new ForbiddenException(
- "The request could not be authorized because the required security principal "
- + key + " could not be determined");
+ throw new ForbiddenException(i18n(
+ "The request could not be authorized because the required "
+ + "security principal '%s' could not be determined", key));
} else {
- // FIXME: i18n.
- throw new ForbiddenException(
- "The request could not be authorized because the required security principal "
- + key + " had an invalid data type");
+ throw new ForbiddenException(i18n(
+ "The request could not be authorized because the required "
+ + "security principal '%s' had an invalid data type", key));
}
}
return values;
--
Gitblit v1.10.0