This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.jcr.jackrabbit.usermanager-2.2.2 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git
commit 08089b25e108c1af0bde209b3cb92b0ceab09886 Author: Carl Franklin Hall <[email protected]> AuthorDate: Thu Jun 7 23:04:43 2012 +0000 SLING-2465 Applied patch from Eric to set user path when creating a user that the creator can't 'see' git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1347825 13f79535-47bb-0310-9956-ffa450edef68 --- .../usermanager/impl/post/CreateUserServlet.java | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java index 638bcbd..df280ed 100644 --- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java +++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java @@ -41,6 +41,7 @@ import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourc import org.apache.sling.jcr.api.SlingRepository; import org.apache.sling.jcr.base.util.AccessControlUtil; import org.apache.sling.servlets.post.Modification; +import org.apache.sling.servlets.post.ModificationType; import org.apache.sling.servlets.post.SlingPostConstants; import org.apache.sling.servlets.post.impl.helper.RequestProperty; import org.osgi.service.component.ComponentContext; @@ -207,10 +208,23 @@ public class CreateUserServlet extends AbstractUserPostServlet implements Create request.getRequestParameterMap(), changes); - String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX - + user.getID(); - response.setPath(userPath); - response.setLocation(externalizePath(request, userPath)); + String userPath = null; + if (user == null) { + if (changes.size() > 0) { + Modification modification = changes.get(0); + if (modification.getType() == ModificationType.CREATE) { + userPath = modification.getSource(); + } + } + } else { + userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX + + user.getID(); + } + + if (userPath != null) { + response.setPath(userPath); + response.setLocation(externalizePath(request, userPath)); + } response.setParentLocation(externalizePath(request, AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PATH)); } -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
