You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:48:54 UTC

[sling-org-apache-sling-jcr-jackrabbit-usermanager] annotated tag org.apache.sling.jcr.jackrabbit.usermanager-2.2.0 created (now fdc08e9)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to annotated tag org.apache.sling.jcr.jackrabbit.usermanager-2.2.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git.


      at fdc08e9  (tag)
 tagging 2072962e9df5e775db469c64bbebc208b1b4d02b (commit)
      by Justin Edelson
      on Fri Nov 11 18:09:41 2011 +0000

- Log -----------------------------------------------------------------
org.apache.sling.jcr.jackrabbit.usermanager-2.2.0
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new 8b60a66  SLING-875 add new jackrabbit-usermanager module (thanks Eric for providing)
     new 854533d  SLING-875: New Bundle for a ResourceProvider and Sling Post Operations for interacting with the jackrabbit UserManager https://issues.apache.org/jira/browse/SLING-875
     new 9b865b8  SLING-941: Lots of svn:eol-style settings missing
     new 2745b63  Use released version of jackrabbit api
     new 72ad816  Use jackrabbit api bundle instead of Sling's obsolete version.
     new 3164640  Use release parent pom
     new 87d5271  Use released version as dependencies.
     new e512ac0  [maven-release-plugin] prepare release org.apache.sling.jcr.jackrabbit.usermanager-2.0.0-incubator
     new 70ae9d9  [maven-release-plugin] prepare for next development iteration
     new 38e866b  Use next dev version of parent pom
     new c2c00c8  Add missing licence, notice etc.
     new 8da015d  Prepare new release.
     new c7de9ac  [maven-release-plugin] prepare release org.apache.sling.jcr.jackrabbit.usermanager-2.0.2-incubator
     new d17523d  [maven-release-plugin] prepare for next development iteration
     new 87eba80  Use next parent pom for development.
     new 3965a10  Set parent pom to released version.
     new a034d92  Formatting ...
     new 3a34397  SLING-995 Applying patch by Ian Boston (thanks)
     new 80ad2b5  Refactor everything below a "private" impl package. This clearly indicates that nothing contained in this bundle is intended to be exported.
     new 62307ef  Remove empty folder
     new 5fdd16c  Replace tabs by spaces, remove unneeded javadoc plugin configuration, remove empty bundle plugin configuration
     new b48249e  Move Sling to new TLP location
     new 1d4d4db  SLING-1011 : Remove disclaimer file.
     new 0884ed7  SLING-1011 : Adjust svn location
     new eea03d2  SLING-1011 : Remove disclaimer from readme's, adjust links to webite, fix versions in poms.
     new 8048a2b  SLING-1016: Make membership management depend on the principal name not the URI of the principal, since the principal name is already unique. https://issues.apache.org/jira/browse/SLING-1016 Patch provided by Ian Boston.
     new 7a0d301  SLING-1033 Upgrade to Sling parent POM 6 (and ensure web app has the leglize stuff, too)
     new be2ee7c  SLING-940 Applied patch from myself. Adds Javadoc to accessmanager and usermanager servlets.
     new 85ff313  SLING-1067 Fixed by checking the session cound to the request to see if its an administrator. If the user is an administrator they can register other users.
     new 3627954  Use official release instead of incubator release.
     new 0336ccc  Update to latest Sling releases.
     new 9166924  SLING-1205 Upgrade all projects to parent POM 8 and use OSGi provided OSGi libraries
     new 3e7a727  SLING-1208 As of Jackrabbit 1.6 the protected properties of the repository reflection of users and groups are not returned as Authorizable properties any more. Therefore the rep:principalName property which is checked in the integration test does not exist any longer. Likeweis the rep:password is not returned any more, so we have to use a (hacky) workaround.
     new d72e1f5  SLING-1208 Wrong commit, we should not re-add the rep:principalName property
     new a85b4aa  SLING-1208 Require Jackrabbit API 1.6 to be sure ...
     new a8f060f  Update notice files.
     new 1b53876  [maven-release-plugin] prepare release org.apache.sling.jcr.jackrabbit.usermanager-2.0.4
     new cba8357  [maven-release-plugin] prepare for next development iteration
     new be4db51  SLING-1378 Provide useful toString implementation
     new e9b4cac  SLING-1379  Support adapt to User and Group
     new ae11ef6  SLING-1377 Use PrincipalManager.getPrincipals method to list groups and users
     new 115a972  SLING-1377 use the actual searchType to find principals and remove old comment
     new 46c01fc  SLING-1212 - upgrading to Jackrabbit 2. Also includes re-revert of SLING-1363 and implementation of SLING-1330. Thanks to Felix for getting this started.
     new c06d6a5  SLING-1453 Provide AuthorizablePrivilegesInfo service to help user/group management scripts query what the current user is allowed to do
     new cb2b1ff  added missing license headers
     new f59c6d0  SLING-1517 - fixing Maven 3 warnings and switching to released version of animal sniffer
     new 5257882  Use released parent pom.
     new 6590355  SLING-1557 - adding members and declaredMembers properties for groups and memberOf and declaredMemberOf properties for users and groups
     new 0a4869d  SLING-1577 - using full property path instead of simple property name in creation of RequestProperty object
     new 396718f  SLING-1193 - updating jackrabbit-usermanager module
     new 7f905a7  SLING-1578 reduce code duplication between post servlet and usermanager
     new cececbf  SLING-1639 Disabling user self-registration is not working
     new 5b0e71b  SLING-1642 User self-registration should be disabled by default
     new b195421  Use latest Sling API release
     new aadce9e  SLING-1676 Let UserManager POST servlets return JSON
     new 4cff8f9  SLING-1698 - setting explicit export version
     new 8610f04  updating all modules to parent 10-SNAPSHOT in anticipation of emma additions to parent
     new 3dab521  using released version of servlet modules
     new c6e89d2  updating pom files pre-release
     new 4847ba4  [maven-release-plugin] prepare release org.apache.sling.jcr.jackrabbit.usermanager-2.1.0
     new c11dee6  [maven-release-plugin] prepare for next development iteration
     new dfa77d8  using latest parent
     new 310e566  Update to recent snapshots
     new a8c3954  Use latest releases.
     new a1c4e89  correct some errors in the javadocs
     new c9dbf96  SLING-2066 improve error reporting for validation errors
     new 66850fe  SLING-2067 Added null check to AuthorizablePrivilegesInfo to fix NPE when used in a script that is being rendered for the anonymous user
     new 418e4bf  SLING-2070 Members of the UserAdmin group can not create a new user
     new f11888d  SLING-2069 PW reset through administrator is not possible. Following the jackrabbit model, members of the UserAdmin group can set the password of other users.
     new 58d6a66  SLING-2072 Add support for disabling users
     new be7b76f  revert change from revision 1100034 that checked in by accident.
     new 82447c7  SLING-1555 UserManager permissions manipulation services that mirror the functionality of the REST operations for programmatic user management code.
     new 02e241e  cleanup metatype labels
     new 1a245d7  SLING-2150 : Update plugins to use the latest available versions
     new b85163e  Update to recent snapshot
     new 98ca2bb  Using latest released parent pom
     new 21090ca  SLING-2187 - adding new module to contain our custom notice file; adding remote-resources plugin configuration to parent pom and removing all existing appended-resources NOTICE files
     new a6ab92c  temporarily using snapshots during release vote
     new a998711  using latest releases
     new a8e4735  tabs -> spaces
     new 11466dd  tabs -> spaces
     new d05da80  bumping package export version and adding since tags
     new 67a0bab  [maven-release-plugin] prepare release org.apache.sling.jcr.jackrabbit.usermanager-2.2.0
     new 2072962  [maven-release-plugin]  copy for tag org.apache.sling.jcr.jackrabbit.usermanager-2.2.0

The 84 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 22/24: bumping package export version and adding since tags

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit d05da807e85f7888ad27d185628a627a003a89c8
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Fri Nov 11 18:04:04 2011 +0000

    bumping package export version and adding since tags
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1201001 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                                 | 2 +-
 .../org/apache/sling/jackrabbit/usermanager/ChangeUserPassword.java     | 2 ++
 src/main/java/org/apache/sling/jackrabbit/usermanager/CreateGroup.java  | 2 ++
 src/main/java/org/apache/sling/jackrabbit/usermanager/CreateUser.java   | 2 ++
 .../org/apache/sling/jackrabbit/usermanager/DeleteAuthorizables.java    | 2 ++
 src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteGroup.java  | 2 ++
 src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteUser.java   | 2 ++
 src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateGroup.java  | 2 ++
 src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateUser.java   | 2 ++
 9 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 18c0134..e0d231a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,7 +61,7 @@
                 <configuration>
                     <instructions>
                         <Export-Package>
-                            org.apache.sling.jackrabbit.usermanager;version=2.1.0,
+                            org.apache.sling.jackrabbit.usermanager;version=2.2.0,
                         </Export-Package>
                         <Private-Package>
                             org.apache.sling.jackrabbit.usermanager.impl.*
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/ChangeUserPassword.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/ChangeUserPassword.java
index 16d1513..9e9c39e 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/ChangeUserPassword.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/ChangeUserPassword.java
@@ -32,6 +32,8 @@ import org.apache.sling.servlets.post.Modification;
  * This interface is not intended to be implemented by bundles. It is
  * implemented by this bundle and may be used by client bundles.
  * </p>
+ * 
+ * @since 2.2.0
  */
 public interface ChangeUserPassword {
 
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateGroup.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateGroup.java
index 56ddf46..11f0f3e 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateGroup.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateGroup.java
@@ -33,6 +33,8 @@ import org.apache.sling.servlets.post.Modification;
  * This interface is not intended to be implemented by bundles. It is
  * implemented by this bundle and may be used by client bundles.
  * </p>
+ * 
+ * @since 2.2.0
  */
 public interface CreateGroup {
 
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateUser.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateUser.java
index a0de69a..fd5ab58 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateUser.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateUser.java
@@ -33,6 +33,8 @@ import org.apache.sling.servlets.post.Modification;
  * This interface is not intended to be implemented by bundles. It is
  * implemented by this bundle and may be used by client bundles.
  * </p>
+ * 
+ * @since 2.2.0
  */
 public interface CreateUser {
 
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteAuthorizables.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteAuthorizables.java
index d6f3e0c..1230fcd 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteAuthorizables.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteAuthorizables.java
@@ -32,6 +32,8 @@ import org.apache.sling.servlets.post.Modification;
  * This interface is not intended to be implemented by bundles. It is
  * implemented by this bundle and may be used by client bundles.
  * </p>
+ * 
+ * @since 2.2.0
  */
 public interface DeleteAuthorizables {
 
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteGroup.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteGroup.java
index be3b30a..318830c 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteGroup.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteGroup.java
@@ -31,6 +31,8 @@ import org.apache.sling.servlets.post.Modification;
  * This interface is not intended to be implemented by bundles. It is
  * implemented by this bundle and may be used by client bundles.
  * </p>
+ * 
+ * @since 2.2.0
  */
 public interface DeleteGroup {
 
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteUser.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteUser.java
index 177c64f..e159040 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteUser.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteUser.java
@@ -31,6 +31,8 @@ import org.apache.sling.servlets.post.Modification;
  * This interface is not intended to be implemented by bundles. It is
  * implemented by this bundle and may be used by client bundles.
  * </p>
+ * 
+ * @since 2.2.0
  */
 public interface DeleteUser {
 
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateGroup.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateGroup.java
index ccc019c..caa57e5 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateGroup.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateGroup.java
@@ -33,6 +33,8 @@ import org.apache.sling.servlets.post.Modification;
  * This interface is not intended to be implemented by bundles. It is
  * implemented by this bundle and may be used by client bundles.
  * </p>
+ * 
+ * @since 2.2.0
  */
 public interface UpdateGroup {
 
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateUser.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateUser.java
index 5b19f89..e1395a6 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateUser.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateUser.java
@@ -33,6 +33,8 @@ import org.apache.sling.servlets.post.Modification;
  * This interface is not intended to be implemented by bundles. It is
  * implemented by this bundle and may be used by client bundles.
  * </p>
+ * 
+ * @since 2.2.0
  */
 public interface UpdateUser {
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 09/24: SLING-2069 PW reset through administrator is not possible. Following the jackrabbit model, members of the UserAdmin group can set the password of other users.

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit f11888d053fd82157127be0b2cea992a50575101
Author: Eric Norman <en...@apache.org>
AuthorDate: Wed May 4 15:11:25 2011 +0000

    SLING-2069 PW reset through administrator is not possible.
    Following the jackrabbit model, members of the UserAdmin group can set the password of other users.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1099482 13f79535-47bb-0310-9956-ffa450edef68
---
 .../impl/post/ChangeUserPasswordServlet.java       | 89 ++++++++++++++++++++--
 1 file changed, 83 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
index 9f5a6ac..0bb1b1e 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
@@ -17,6 +17,7 @@
 package org.apache.sling.jackrabbit.usermanager.impl.post;
 
 import java.lang.reflect.Method;
+import java.util.Dictionary;
 import java.util.List;
 
 import javax.jcr.Credentials;
@@ -24,12 +25,19 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
 import org.apache.jackrabbit.api.security.user.Authorizable;
+import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.User;
+import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceNotFoundException;
 import org.apache.sling.api.servlets.HtmlResponse;
+import org.apache.sling.commons.osgi.OsgiUtil;
+import org.apache.sling.jcr.base.util.AccessControlUtil;
 import org.apache.sling.servlets.post.Modification;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <p>
@@ -45,7 +53,7 @@ import org.apache.sling.servlets.post.Modification;
  * <h4>Post Parameters</h4>
  * <dl>
  * <dt>oldPwd</dt>
- * <dd>The current password for the user (required)</dd>
+ * <dd>The current password for the user (required for non-administrators)</dd>
  * <dt>newPwd</dt>
  * <dd>The new password for the user (required)</dd>
  * <dt>newPwdConfirm</dt>
@@ -63,13 +71,13 @@ import org.apache.sling.servlets.post.Modification;
  * <h4>Example</h4>
  *
  * <code>
- * curl -FoldPwd=oldpassword -FnewPwd=newpassword =FnewPwdConfirm=newpassword http://localhost:8080/system/userManager/user/ieb.changePassword.html
+ * curl -FoldPwd=oldpassword -FnewPwd=newpassword -FnewPwdConfirm=newpassword http://localhost:8080/system/userManager/user/ieb.changePassword.html
  * </code>
  *
  * <h4>Notes</h4>
  *
  *
- * @scr.component metatype="no" immediate="true"
+ * @scr.component immediate="true"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.property name="sling.servlet.resourceTypes" value="sling/user"
  * @scr.property name="sling.servlet.methods" value="POST"
@@ -78,6 +86,46 @@ import org.apache.sling.servlets.post.Modification;
 public class ChangeUserPasswordServlet extends AbstractUserPostServlet {
     private static final long serialVersionUID = 1923614318474654502L;
 
+    /**
+     * default log
+     */
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    /**
+     * The name of the configuration parameter providing the 
+     * name of the group whose members are allowed to reset the password
+     * of a user without the 'oldPwd' value.
+     *
+     * @scr.property valueRef="DEFAULT_USER_ADMIN_GROUP_NAME"
+     */
+    private static final String PAR_USER_ADMIN_GROUP_NAME = "user.admin.group.name";
+
+    /**
+     * The default 'User administrator' group name
+     *
+     * @see #PAR_USER_ADMIN_GROUP_NAME
+     */
+    private static final String DEFAULT_USER_ADMIN_GROUP_NAME = "UserAdmin";
+ 
+    private String userAdminGroupName = DEFAULT_USER_ADMIN_GROUP_NAME;
+    
+    // ---------- SCR integration ---------------------------------------------
+
+    /**
+     * Activates this component.
+     *
+     * @param componentContext The OSGi <code>ComponentContext</code> of this
+     *            component.
+     */
+    protected void activate(ComponentContext componentContext) {
+        super.activate(componentContext);
+        Dictionary<?, ?> props = componentContext.getProperties();
+        
+        this.userAdminGroupName = OsgiUtil.toString(props.get(PAR_USER_ADMIN_GROUP_NAME),
+        		DEFAULT_USER_ADMIN_GROUP_NAME);
+        log.info("User Admin Group Name {}", this.userAdminGroupName);
+    }
+    
     /*
      * (non-Javadoc)
      * @see
@@ -111,10 +159,37 @@ public class ChangeUserPasswordServlet extends AbstractUserPostServlet {
             throw new RepositoryException("JCR Session not found");
         }
 
+    	//SLING-2069: if the current user is an administrator, then a missing oldPwd is ok,
+    	// otherwise the oldPwd must be supplied.
+        boolean administrator = false;
+
         // check that the submitted parameter values have valid values.
         String oldPwd = request.getParameter("oldPwd");
         if (oldPwd == null || oldPwd.length() == 0) {
-            throw new RepositoryException("Old Password was not submitted");
+            try {
+                Session currentSession = request.getResourceResolver().adaptTo(Session.class);
+                UserManager um = AccessControlUtil.getUserManager(currentSession);
+                User currentUser = (User) um.getAuthorizable(currentSession.getUserID());
+                administrator = currentUser.isAdmin();
+                
+                if (!administrator) {
+    				//check if the user is a member of the 'User administrator' group
+    				Authorizable userAdmin = um.getAuthorizable(this.userAdminGroupName);
+    				if (userAdmin instanceof Group) {
+    					boolean isMember = ((Group)userAdmin).isMember(currentUser);
+    					if (isMember) {
+    						administrator = true;
+    					}
+    				}
+                	
+                }
+            } catch ( Exception ex ) {
+                log.warn("Failed to determine if the user is an admin, assuming not. Cause: "+ex.getMessage());
+                administrator = false;
+            }
+            if (!administrator) {
+            	throw new RepositoryException("Old Password was not submitted");
+            }
         }
         String newPwd = request.getParameter("newPwd");
         if (newPwd == null || newPwd.length() == 0) {
@@ -126,8 +201,10 @@ public class ChangeUserPasswordServlet extends AbstractUserPostServlet {
                 "New Password does not match the confirmation password");
         }
 
-        // verify old password
-        checkPassword(authorizable, oldPwd);
+        if (oldPwd != null && oldPwd.length() > 0) {
+            // verify old password
+            checkPassword(authorizable, oldPwd);
+        }
 
         try {
             ((User) authorizable).changePassword(digestPassword(newPwd));

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 18/24: temporarily using snapshots during release vote

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit a6ab92c76e3932889ee96d15f8b4c78726101524
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Aug 31 20:10:55 2011 +0000

    temporarily using snapshots during release vote
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1163785 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 2607d12..14ea6f1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>12-SNAPSHOT</version>
+        <version>13-SNAPSHOT</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 15/24: Update to recent snapshot

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit b85163ec20024df337505c40949b189fa5c428c1
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Aug 3 09:01:37 2011 +0000

    Update to recent snapshot
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1153397 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 2e9348f..2607d12 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>11-SNAPSHOT</version>
+        <version>12-SNAPSHOT</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 17/24: SLING-2187 - adding new module to contain our custom notice file; adding remote-resources plugin configuration to parent pom and removing all existing appended-resources NOTICE files

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 21090ca62ea12e0cf4ed425387877063ffaecef6
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Aug 31 19:23:49 2011 +0000

    SLING-2187 - adding new module to contain our custom notice file; adding remote-resources plugin configuration to parent pom and removing all existing appended-resources NOTICE files
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1163752 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 9c92c21..2607d12 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>11</version>
+        <version>12-SNAPSHOT</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 24/24: [maven-release-plugin] copy for tag org.apache.sling.jcr.jackrabbit.usermanager-2.2.0

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 2072962e9df5e775db469c64bbebc208b1b4d02b
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Fri Nov 11 18:09:41 2011 +0000

    [maven-release-plugin]  copy for tag org.apache.sling.jcr.jackrabbit.usermanager-2.2.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.jackrabbit.usermanager-2.2.0@1201004 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 05/24: correct some errors in the javadocs

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit a1c4e895e4dcf79bacdb410d2b8b20eeebf03005
Author: Eric Norman <en...@apache.org>
AuthorDate: Sun May 1 22:59:23 2011 +0000

    correct some errors in the javadocs
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1098434 13f79535-47bb-0310-9956-ffa450edef68
---
 .../usermanager/impl/post/ChangeUserPasswordServlet.java          | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
index a741b2c..9f5a6ac 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
@@ -33,10 +33,10 @@ import org.apache.sling.servlets.post.Modification;
 
 /**
  * <p>
- * Changes the password associated with a user. a new group. Maps on to nodes of resourceType <code>sling/groups</code> like
+ * Changes the password associated with a user. Maps on to nodes of resourceType <code>sling/user</code> like
  * <code>/rep:system/rep:userManager/rep:users/ae/fd/3e/ieb</code> mapped to a resource url
  * <code>/system/userManager/user/ieb</code>. This servlet responds at
- * <code>/system/userManager/user/ieb.changePassword.create.html</code>
+ * <code>/system/userManager/user/ieb.changePassword.html</code>
  * </p>
  * <h4>Methods</h4>
  * <ul>
@@ -54,11 +54,11 @@ import org.apache.sling.servlets.post.Modification;
  * <h4>Response</h4>
  * <dl>
  * <dt>200</dt>
- * <dd>Sucess sent with no body</dd>
+ * <dd>Success sent with no body</dd>
  * <dt>404</dt>
  * <dd>If the user was not found.</dd>
  * <dt>500</dt>
- * <dd>Failure, including group already exists. HTML explains the failure.</dd>
+ * <dd>Failure, including password validation errors. HTML explains the failure.</dd>
  * </dl>
  * <h4>Example</h4>
  *

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 10/24: SLING-2072 Add support for disabling users

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 58d6a66d8292146320230849d56c464484667878
Author: Eric Norman <en...@apache.org>
AuthorDate: Fri May 6 03:17:47 2011 +0000

    SLING-2072 Add support for disabling users
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1100034 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  2 +-
 .../impl/AuthorizablePrivilegesInfoImpl.java       |  9 --------
 .../usermanager/impl/post/UpdateUserServlet.java   | 24 +++++++++++++++++-----
 3 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/pom.xml b/pom.xml
index cea2e17..9f832c6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -95,7 +95,7 @@
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
             <artifactId>jackrabbit-api</artifactId>
-            <version>2.0.0</version>
+            <version>2.2.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
index f3fc51a..48dfa38 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
@@ -243,15 +243,6 @@ public class AuthorizablePrivilegesInfoImpl implements AuthorizablePrivilegesInf
 						return true;
 					}
 				}
-				
-				//check if the user is a member of the 'User administrator' group
-				Authorizable userAdmin = userManager.getAuthorizable(this.userAdminGroupName);
-				if (userAdmin instanceof Group) {
-					boolean isMember = ((Group)userAdmin).isMember(currentUser);
-					if (isMember) {
-						return true;
-					}
-				}
 			}
 		} catch (RepositoryException e) {
 			log.warn("Failed to determine if {} can remove authorizable {}", jcrSession.getUserID(), groupId);
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
index cf908a3..31210b5 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
@@ -22,14 +22,14 @@ import java.util.Map;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
-import org.apache.jackrabbit.api.security.user.Authorizable;
+import org.apache.jackrabbit.api.security.user.User;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceNotFoundException;
 import org.apache.sling.api.servlets.HtmlResponse;
-import org.apache.sling.servlets.post.impl.helper.RequestProperty;
 import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
 import org.apache.sling.servlets.post.Modification;
+import org.apache.sling.servlets.post.impl.helper.RequestProperty;
 
 /**
  * <p>
@@ -91,10 +91,10 @@ public class UpdateUserServlet extends AbstractUserPostServlet {
     protected void handleOperation(SlingHttpServletRequest request,
             HtmlResponse htmlResponse, List<Modification> changes)
             throws RepositoryException {
-        Authorizable authorizable = null;
+        User authorizable = null;
         Resource resource = request.getResource();
         if (resource != null) {
-            authorizable = resource.adaptTo(Authorizable.class);
+            authorizable = resource.adaptTo(User.class);
         }
 
         // check that the group was located.
@@ -119,7 +119,21 @@ public class UpdateUserServlet extends AbstractUserPostServlet {
 
             // write content from form
             writeContent(session, authorizable, reqProperties, changes);
-
+            
+            //SLING-2072 set the user as enabled or disabled if the request
+            // has supplied the relev
+            String disabledParam = request.getParameter(":disabled");
+            if ("true".equalsIgnoreCase(disabledParam)) {
+            	//set the user as disabled
+            	String disabledReason = request.getParameter(":disabledReason");
+            	if (disabledReason == null) {
+            		disabledReason = "";
+            	}
+            	authorizable.disable(disabledReason);
+            } else if ("false".equalsIgnoreCase(disabledParam)) {
+            	//re-enable a disabled user
+            	authorizable.disable(null);
+            }
         } catch (RepositoryException re) {
             throw new RepositoryException("Failed to update user.", re);
         }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 14/24: SLING-2150 : Update plugins to use the latest available versions

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 1a245d757b973b8d66152e399d6598ab220d782b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Jul 20 12:21:40 2011 +0000

    SLING-2150 : Update plugins to use the latest available versions
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1148722 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 9f832c6..2e9348f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>10</version>
+        <version>11-SNAPSHOT</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 06/24: SLING-2066 improve error reporting for validation errors

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit c9dbf96811ed3bdeeaf3d923a62b2eb856643034
Author: Eric Norman <en...@apache.org>
AuthorDate: Sun May 1 23:06:30 2011 +0000

    SLING-2066 improve error reporting for validation errors
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1098436 13f79535-47bb-0310-9956-ffa450edef68
---
 .../usermanager/impl/post/CreateGroupServlet.java  | 60 ++++++++++------------
 .../usermanager/impl/post/CreateUserServlet.java   |  2 +-
 2 files changed, 29 insertions(+), 33 deletions(-)

diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
index 5a24c84..5e2ea88 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
@@ -95,7 +95,7 @@ public class CreateGroupServlet extends AbstractGroupPostServlet {
 
         // check that the submitted parameter values have valid values.
         final String principalName = request.getParameter(SlingPostConstants.RP_NODE_NAME);
-        if (principalName == null) {
+        if (principalName == null || principalName.length() == 0) {
             throw new RepositoryException("Group name was not submitted");
         }
 
@@ -104,41 +104,37 @@ public class CreateGroupServlet extends AbstractGroupPostServlet {
             throw new RepositoryException("JCR Session not found");
         }
 
-        try {
-            UserManager userManager = AccessControlUtil.getUserManager(session);
-            Authorizable authorizable = userManager.getAuthorizable(principalName);
+        UserManager userManager = AccessControlUtil.getUserManager(session);
+        Authorizable authorizable = userManager.getAuthorizable(principalName);
 
-            if (authorizable != null) {
-                // principal already exists!
-                throw new RepositoryException(
-                    "A principal already exists with the requested name: "
-                        + principalName);
-            } else {
-                Group group = userManager.createGroup(new Principal() {
-                    public String getName() {
-                        return principalName;
-                    }
-                });
+        if (authorizable != null) {
+            // principal already exists!
+            throw new RepositoryException(
+                "A principal already exists with the requested name: "
+                    + principalName);
+        } else {
+            Group group = userManager.createGroup(new Principal() {
+                public String getName() {
+                    return principalName;
+                }
+            });
 
-                String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
-                    + group.getID();
-                
-                Map<String, RequestProperty> reqProperties = collectContent(
-                    request, response, groupPath);
-                response.setPath(groupPath);
-                response.setLocation(externalizePath(request, groupPath));
-                response.setParentLocation(externalizePath(request,
-                    AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PATH));
-                changes.add(Modification.onCreated(groupPath));
+            String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
+                + group.getID();
+            
+            Map<String, RequestProperty> reqProperties = collectContent(
+                request, response, groupPath);
+            response.setPath(groupPath);
+            response.setLocation(externalizePath(request, groupPath));
+            response.setParentLocation(externalizePath(request,
+                AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PATH));
+            changes.add(Modification.onCreated(groupPath));
 
-                // write content from form
-                writeContent(session, group, reqProperties, changes);
+            // write content from form
+            writeContent(session, group, reqProperties, changes);
 
-                // update the group memberships
-                updateGroupMembership(request, group, changes);
-            }
-        } catch (RepositoryException re) {
-            throw new RepositoryException("Failed to create new group.", re);
+            // update the group memberships
+            updateGroupMembership(request, group, changes);
         }
     }
 }
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 a72ea5a..34cf4c2 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
@@ -195,7 +195,7 @@ public class CreateUserServlet extends AbstractUserPostServlet {
 
         // check that the submitted parameter values have valid values.
         String principalName = request.getParameter(SlingPostConstants.RP_NODE_NAME);
-        if (principalName == null) {
+        if (principalName == null || principalName.length() == 0) {
             throw new RepositoryException("User name was not submitted");
         }
         String pwd = request.getParameter("pwd");

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 13/24: cleanup metatype labels

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 02e241e792479076377143eadf54057337944d8f
Author: Eric Norman <en...@apache.org>
AuthorDate: Sat May 21 19:51:21 2011 +0000

    cleanup metatype labels
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1125779 13f79535-47bb-0310-9956-ffa450edef68
---
 .../impl/post/AbstractAuthorizablePostServlet.java | 257 +-----------------
 .../usermanager/impl/post/AbstractPostServlet.java | 293 +++++++++++++++++++++
 .../impl/post/ChangeUserPasswordServlet.java       |   3 +-
 .../usermanager/impl/post/CreateGroupServlet.java  |   3 +-
 .../impl/post/DeleteAuthorizableServlet.java       |   5 +-
 .../usermanager/impl/post/UpdateGroupServlet.java  |   3 +-
 .../usermanager/impl/post/UpdateUserServlet.java   |   3 +-
 .../resource/AuthorizableResourceProvider.java     |   2 +-
 .../OSGI-INF/metatype/metatype.properties          |  28 +-
 9 files changed, 331 insertions(+), 266 deletions(-)

diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java
index d6d743a..40f6a96 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java
@@ -17,10 +17,8 @@
 package org.apache.sling.jackrabbit.usermanager.impl.post;
 
 import java.io.ByteArrayInputStream;
-import java.io.IOException;
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Dictionary;
 import java.util.HashMap;
@@ -34,43 +32,26 @@ import javax.jcr.Session;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 
 import org.apache.jackrabbit.api.security.user.Authorizable;
-import org.apache.sling.api.SlingHttpServletRequest;
-import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.SlingIOException;
 import org.apache.sling.api.request.RequestParameter;
-import org.apache.sling.api.resource.ResourceNotFoundException;
-import org.apache.sling.api.resource.ResourceUtil;
-import org.apache.sling.api.servlets.HtmlResponse;
-import org.apache.sling.api.servlets.SlingAllMethodsServlet;
-import org.apache.sling.api.wrappers.SlingRequestPaths;
 import org.apache.sling.commons.osgi.OsgiUtil;
 import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
 import org.apache.sling.servlets.post.Modification;
 import org.apache.sling.servlets.post.SlingPostConstants;
 import org.apache.sling.servlets.post.impl.helper.DateParser;
-import org.apache.sling.servlets.post.impl.helper.JSONResponse;
 import org.apache.sling.servlets.post.impl.helper.RequestProperty;
 import org.osgi.service.component.ComponentContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Base class for all the POST servlets for the UserManager operations
  */
 public abstract class AbstractAuthorizablePostServlet extends
-        SlingAllMethodsServlet {
+        AbstractPostServlet {
     private static final long serialVersionUID = -5918670409789895333L;
 
     /**
-     * default log
-     */
-    private final Logger log = LoggerFactory.getLogger(getClass());
-
-    /**
      * @scr.property values.0="EEE MMM dd yyyy HH:mm:ss 'GMT'Z"
      *               values.1="yyyy-MM-dd'T'HH:mm:ss.SSSZ"
      *               values.2="yyyy-MM-dd'T'HH:mm:ss" values.3="yyyy-MM-dd"
@@ -96,207 +77,6 @@ public abstract class AbstractAuthorizablePostServlet extends
         dateParser = null;
     }
 
-    /*
-     * (non-Javadoc)
-     * @see
-     * org.apache.sling.api.servlets.SlingAllMethodsServlet#doPost(org.apache
-     * .sling.api.SlingHttpServletRequest,
-     * org.apache.sling.api.SlingHttpServletResponse)
-     */
-    @Override
-    protected void doPost(SlingHttpServletRequest request,
-            SlingHttpServletResponse httpResponse) throws ServletException,
-            IOException {
-        // prepare the response
-        HtmlResponse htmlResponse = createHtmlResponse(request);
-        htmlResponse.setReferer(request.getHeader("referer"));
-
-        // calculate the paths
-        String path = getItemPath(request);
-        htmlResponse.setPath(path);
-
-        // location
-        htmlResponse.setLocation(externalizePath(request, path));
-
-        // parent location
-        path = ResourceUtil.getParent(path);
-        if (path != null) {
-            htmlResponse.setParentLocation(externalizePath(request, path));
-        }
-
-        Session session = request.getResourceResolver().adaptTo(Session.class);
-
-        final List<Modification> changes = new ArrayList<Modification>();
-
-        try {
-            handleOperation(request, htmlResponse, changes);
-
-            // TODO: maybe handle SlingAuthorizablePostProcessor handlers here
-
-            // set changes on html response
-            for (Modification change : changes) {
-                switch (change.getType()) {
-                    case MODIFY:
-                        htmlResponse.onModified(change.getSource());
-                        break;
-                    case DELETE:
-                        htmlResponse.onDeleted(change.getSource());
-                        break;
-                    case MOVE:
-                        htmlResponse.onMoved(change.getSource(),
-                            change.getDestination());
-                        break;
-                    case COPY:
-                        htmlResponse.onCopied(change.getSource(),
-                            change.getDestination());
-                        break;
-                    case CREATE:
-                        htmlResponse.onCreated(change.getSource());
-                        break;
-                    case ORDER:
-                        htmlResponse.onChange("ordered", change.getSource(),
-                            change.getDestination());
-                        break;
-                }
-            }
-
-            if (session.hasPendingChanges()) {
-                session.save();
-            }
-        } catch (ResourceNotFoundException rnfe) {
-            htmlResponse.setStatus(HttpServletResponse.SC_NOT_FOUND,
-                rnfe.getMessage());
-        } catch (Throwable throwable) {
-            log.debug("Exception while handling POST "
-                + request.getResource().getPath() + " with "
-                + getClass().getName(), throwable);
-            htmlResponse.setError(throwable);
-        } finally {
-            try {
-                if (session.hasPendingChanges()) {
-                    session.refresh(false);
-                }
-            } catch (RepositoryException e) {
-                log.warn("RepositoryException in finally block: {}",
-                    e.getMessage(), e);
-            }
-        }
-
-        // check for redirect URL if processing succeeded
-        if (htmlResponse.isSuccessful()) {
-            String redirect = getRedirectUrl(request, htmlResponse);
-            if (redirect != null) {
-                httpResponse.sendRedirect(redirect);
-                return;
-            }
-        }
-
-        // create a html response and send if unsuccessful or no redirect
-        htmlResponse.send(httpResponse, isSetStatus(request));
-    }
-
-    /**
-     * Creates an instance of a HtmlResponse.
-     * @param req The request being serviced
-     * @return a {@link org.apache.sling.servlets.post.impl.helper.JSONResponse} if any of these conditions are true:
-     * <ul>
-     *   <li>the response content type is application/json
-     * </ul>
-     * or a {@link org.apache.sling.api.servlets.HtmlResponse} otherwise
-     */
-    protected HtmlResponse createHtmlResponse(SlingHttpServletRequest req) {
-    	if (JSONResponse.RESPONSE_CONTENT_TYPE.equals(req.getResponseContentType())) {
-    		return new JSONResponse();
-    	} else {
-            return new HtmlResponse();
-    	}
-    }
-    
-    /**
-     * Extending Servlet should implement this operation to do the work
-     * 
-     * @param request the sling http request to process
-     * @param htmlResponse the response
-     * @param changes
-     */
-    abstract protected void handleOperation(SlingHttpServletRequest request,
-            HtmlResponse htmlResponse, List<Modification> changes)
-            throws RepositoryException;
-
-    /**
-     * compute redirect URL (SLING-126)
-     * 
-     * @param ctx the post processor
-     * @return the redirect location or <code>null</code>
-     */
-    protected String getRedirectUrl(HttpServletRequest request, HtmlResponse ctx) {
-        // redirect param has priority (but see below, magic star)
-        String result = request.getParameter(SlingPostConstants.RP_REDIRECT_TO);
-        if (result != null && ctx.getPath() != null) {
-
-            // redirect to created/modified Resource
-            int star = result.indexOf('*');
-            if (star >= 0) {
-                StringBuffer buf = new StringBuffer();
-
-                // anything before the star
-                if (star > 0) {
-                    buf.append(result.substring(0, star));
-                }
-
-                // append the name of the manipulated node
-                buf.append(ResourceUtil.getName(ctx.getPath()));
-
-                // anything after the star
-                if (star < result.length() - 1) {
-                    buf.append(result.substring(star + 1));
-                }
-
-                // use the created path as the redirect result
-                result = buf.toString();
-
-            } else if (result.endsWith(SlingPostConstants.DEFAULT_CREATE_SUFFIX)) {
-                // if the redirect has a trailing slash, append modified node
-                // name
-                result = result.concat(ResourceUtil.getName(ctx.getPath()));
-            }
-
-            if (log.isDebugEnabled()) {
-                log.debug("Will redirect to " + result);
-            }
-        }
-        return result;
-    }
-
-    protected boolean isSetStatus(SlingHttpServletRequest request) {
-        String statusParam = request.getParameter(SlingPostConstants.RP_STATUS);
-        if (statusParam == null) {
-            log.debug(
-                "getStatusMode: Parameter {} not set, assuming standard status code",
-                SlingPostConstants.RP_STATUS);
-            return true;
-        }
-
-        if (SlingPostConstants.STATUS_VALUE_BROWSER.equals(statusParam)) {
-            log.debug(
-                "getStatusMode: Parameter {} asks for user-friendly status code",
-                SlingPostConstants.RP_STATUS);
-            return false;
-        }
-
-        if (SlingPostConstants.STATUS_VALUE_STANDARD.equals(statusParam)) {
-            log.debug(
-                "getStatusMode: Parameter {} asks for standard status code",
-                SlingPostConstants.RP_STATUS);
-            return true;
-        }
-
-        log.debug(
-            "getStatusMode: Parameter {} set to unknown value {}, assuming standard status code",
-            SlingPostConstants.RP_STATUS);
-        return true;
-    }
-
     // ------ The methods below are based on the private methods from the
     // ModifyOperation class -----
 
@@ -690,41 +470,6 @@ public abstract class AbstractAuthorizablePostServlet extends
     // ------ These methods were copied from AbstractSlingPostOperation ------
 
     /**
-     * Returns the path of the resource of the request as the item path.
-     * <p>
-     * This method may be overwritten by extension if the operation has
-     * different requirements on path processing.
-     */
-    protected String getItemPath(SlingHttpServletRequest request) {
-        return request.getResource().getPath();
-    }
-
-    /**
-     * Returns an external form of the given path prepending the context path
-     * and appending a display extension.
-     * 
-     * @param path the path to externalize
-     * @return the url
-     */
-    protected final String externalizePath(SlingHttpServletRequest request,
-            String path) {
-        StringBuffer ret = new StringBuffer();
-        ret.append(SlingRequestPaths.getContextPath(request));
-        ret.append(request.getResourceResolver().map(path));
-
-        // append optional extension
-        String ext = request.getParameter(SlingPostConstants.RP_DISPLAY_EXTENSION);
-        if (ext != null && ext.length() > 0) {
-            if (ext.charAt(0) != '.') {
-                ret.append('.');
-            }
-            ret.append(ext);
-        }
-
-        return ret.toString();
-    }
-
-    /**
      * Returns <code>true</code> if the <code>name</code> starts with either of
      * the prefixes {@link SlingPostConstants#ITEM_PREFIX_RELATIVE_CURRENT
      * <code>./</code>}, {@link SlingPostConstants#ITEM_PREFIX_RELATIVE_PARENT
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractPostServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractPostServlet.java
new file mode 100644
index 0000000..e6e0311
--- /dev/null
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractPostServlet.java
@@ -0,0 +1,293 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.jackrabbit.usermanager.impl.post;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.SlingHttpServletResponse;
+import org.apache.sling.api.resource.ResourceNotFoundException;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.api.servlets.HtmlResponse;
+import org.apache.sling.api.servlets.SlingAllMethodsServlet;
+import org.apache.sling.api.wrappers.SlingRequestPaths;
+import org.apache.sling.servlets.post.Modification;
+import org.apache.sling.servlets.post.SlingPostConstants;
+import org.apache.sling.servlets.post.impl.helper.JSONResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Base class for all the POST servlets for the UserManager operations
+ */
+public abstract class AbstractPostServlet extends
+        SlingAllMethodsServlet {
+
+	private static final long serialVersionUID = 7408267654653472120L;
+	
+	/**
+     * default log
+     */
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    /*
+     * (non-Javadoc)
+     * @see
+     * org.apache.sling.api.servlets.SlingAllMethodsServlet#doPost(org.apache
+     * .sling.api.SlingHttpServletRequest,
+     * org.apache.sling.api.SlingHttpServletResponse)
+     */
+    @Override
+    protected void doPost(SlingHttpServletRequest request,
+            SlingHttpServletResponse httpResponse) throws ServletException,
+            IOException {
+        // prepare the response
+        HtmlResponse htmlResponse = createHtmlResponse(request);
+        htmlResponse.setReferer(request.getHeader("referer"));
+
+        // calculate the paths
+        String path = getItemPath(request);
+        htmlResponse.setPath(path);
+
+        // location
+        htmlResponse.setLocation(externalizePath(request, path));
+
+        // parent location
+        path = ResourceUtil.getParent(path);
+        if (path != null) {
+            htmlResponse.setParentLocation(externalizePath(request, path));
+        }
+
+        Session session = request.getResourceResolver().adaptTo(Session.class);
+
+        final List<Modification> changes = new ArrayList<Modification>();
+
+        try {
+            handleOperation(request, htmlResponse, changes);
+
+            // TODO: maybe handle SlingAuthorizablePostProcessor handlers here
+
+            // set changes on html response
+            for (Modification change : changes) {
+                switch (change.getType()) {
+                    case MODIFY:
+                        htmlResponse.onModified(change.getSource());
+                        break;
+                    case DELETE:
+                        htmlResponse.onDeleted(change.getSource());
+                        break;
+                    case MOVE:
+                        htmlResponse.onMoved(change.getSource(),
+                            change.getDestination());
+                        break;
+                    case COPY:
+                        htmlResponse.onCopied(change.getSource(),
+                            change.getDestination());
+                        break;
+                    case CREATE:
+                        htmlResponse.onCreated(change.getSource());
+                        break;
+                    case ORDER:
+                        htmlResponse.onChange("ordered", change.getSource(),
+                            change.getDestination());
+                        break;
+                }
+            }
+
+            if (session.hasPendingChanges()) {
+                session.save();
+            }
+        } catch (ResourceNotFoundException rnfe) {
+            htmlResponse.setStatus(HttpServletResponse.SC_NOT_FOUND,
+                rnfe.getMessage());
+        } catch (Throwable throwable) {
+            log.debug("Exception while handling POST "
+                + request.getResource().getPath() + " with "
+                + getClass().getName(), throwable);
+            htmlResponse.setError(throwable);
+        } finally {
+            try {
+                if (session.hasPendingChanges()) {
+                    session.refresh(false);
+                }
+            } catch (RepositoryException e) {
+                log.warn("RepositoryException in finally block: {}",
+                    e.getMessage(), e);
+            }
+        }
+
+        // check for redirect URL if processing succeeded
+        if (htmlResponse.isSuccessful()) {
+            String redirect = getRedirectUrl(request, htmlResponse);
+            if (redirect != null) {
+                httpResponse.sendRedirect(redirect);
+                return;
+            }
+        }
+
+        // create a html response and send if unsuccessful or no redirect
+        htmlResponse.send(httpResponse, isSetStatus(request));
+    }
+
+    /**
+     * Creates an instance of a HtmlResponse.
+     * @param req The request being serviced
+     * @return a {@link org.apache.sling.servlets.post.impl.helper.JSONResponse} if any of these conditions are true:
+     * <ul>
+     *   <li>the response content type is application/json
+     * </ul>
+     * or a {@link org.apache.sling.api.servlets.HtmlResponse} otherwise
+     */
+    protected HtmlResponse createHtmlResponse(SlingHttpServletRequest req) {
+    	if (JSONResponse.RESPONSE_CONTENT_TYPE.equals(req.getResponseContentType())) {
+    		return new JSONResponse();
+    	} else {
+            return new HtmlResponse();
+    	}
+    }
+    
+    /**
+     * Extending Servlet should implement this operation to do the work
+     * 
+     * @param request the sling http request to process
+     * @param htmlResponse the response
+     * @param changes
+     */
+    abstract protected void handleOperation(SlingHttpServletRequest request,
+            HtmlResponse htmlResponse, List<Modification> changes)
+            throws RepositoryException;
+
+    /**
+     * compute redirect URL (SLING-126)
+     * 
+     * @param ctx the post processor
+     * @return the redirect location or <code>null</code>
+     */
+    protected String getRedirectUrl(HttpServletRequest request, HtmlResponse ctx) {
+        // redirect param has priority (but see below, magic star)
+        String result = request.getParameter(SlingPostConstants.RP_REDIRECT_TO);
+        if (result != null && ctx.getPath() != null) {
+
+            // redirect to created/modified Resource
+            int star = result.indexOf('*');
+            if (star >= 0) {
+                StringBuffer buf = new StringBuffer();
+
+                // anything before the star
+                if (star > 0) {
+                    buf.append(result.substring(0, star));
+                }
+
+                // append the name of the manipulated node
+                buf.append(ResourceUtil.getName(ctx.getPath()));
+
+                // anything after the star
+                if (star < result.length() - 1) {
+                    buf.append(result.substring(star + 1));
+                }
+
+                // use the created path as the redirect result
+                result = buf.toString();
+
+            } else if (result.endsWith(SlingPostConstants.DEFAULT_CREATE_SUFFIX)) {
+                // if the redirect has a trailing slash, append modified node
+                // name
+                result = result.concat(ResourceUtil.getName(ctx.getPath()));
+            }
+
+            if (log.isDebugEnabled()) {
+                log.debug("Will redirect to " + result);
+            }
+        }
+        return result;
+    }
+
+    protected boolean isSetStatus(SlingHttpServletRequest request) {
+        String statusParam = request.getParameter(SlingPostConstants.RP_STATUS);
+        if (statusParam == null) {
+            log.debug(
+                "getStatusMode: Parameter {} not set, assuming standard status code",
+                SlingPostConstants.RP_STATUS);
+            return true;
+        }
+
+        if (SlingPostConstants.STATUS_VALUE_BROWSER.equals(statusParam)) {
+            log.debug(
+                "getStatusMode: Parameter {} asks for user-friendly status code",
+                SlingPostConstants.RP_STATUS);
+            return false;
+        }
+
+        if (SlingPostConstants.STATUS_VALUE_STANDARD.equals(statusParam)) {
+            log.debug(
+                "getStatusMode: Parameter {} asks for standard status code",
+                SlingPostConstants.RP_STATUS);
+            return true;
+        }
+
+        log.debug(
+            "getStatusMode: Parameter {} set to unknown value {}, assuming standard status code",
+            SlingPostConstants.RP_STATUS);
+        return true;
+    }
+
+    // ------ These methods were copied from AbstractSlingPostOperation ------
+
+    /**
+     * Returns the path of the resource of the request as the item path.
+     * <p>
+     * This method may be overwritten by extension if the operation has
+     * different requirements on path processing.
+     */
+    protected String getItemPath(SlingHttpServletRequest request) {
+        return request.getResource().getPath();
+    }
+
+    /**
+     * Returns an external form of the given path prepending the context path
+     * and appending a display extension.
+     * 
+     * @param path the path to externalize
+     * @return the url
+     */
+    protected final String externalizePath(SlingHttpServletRequest request,
+            String path) {
+        StringBuffer ret = new StringBuffer();
+        ret.append(SlingRequestPaths.getContextPath(request));
+        ret.append(request.getResourceResolver().map(path));
+
+        // append optional extension
+        String ext = request.getParameter(SlingPostConstants.RP_DISPLAY_EXTENSION);
+        if (ext != null && ext.length() > 0) {
+            if (ext.charAt(0) != '.') {
+                ret.append('.');
+            }
+            ret.append(ext);
+        }
+
+        return ret.toString();
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
index eb31397..b5d5dd5 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
@@ -79,7 +79,8 @@ import org.slf4j.LoggerFactory;
  * <h4>Notes</h4>
  *
  *
- * @scr.component immediate="true"
+ * @scr.component immediate="true" label="%changeUserPassword.post.operation.name"
+ *                description="%changeUserPassword.post.operation.description"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.service interface="org.apache.sling.jackrabbit.usermanager.ChangeUserPassword"
  * @scr.property name="sling.servlet.resourceTypes" value="sling/user"
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
index 64fdf48..88721e1 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
@@ -76,7 +76,8 @@ import org.apache.sling.servlets.post.SlingPostConstants;
  * 
  * <h4>Notes</h4>
  * 
- * @scr.component immediate="true"
+ * @scr.component immediate="true" label="%createGroup.post.operation.name"
+ *                description="%createGroup.post.operation.description"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.service interface="org.apache.sling.jackrabbit.usermanager.CreateGroup"
  * @scr.property name="sling.servlet.resourceTypes" value="sling/groups"
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java
index 1de78f6..088197a 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java
@@ -76,7 +76,8 @@ import org.apache.sling.servlets.post.SlingPostConstants;
  * </code>
  *
  *
- * @scr.component metatype="no" immediate="true"
+ * @scr.component immediate="true" label="%deleteAuthorizable.post.operation.name"
+ *                description="%deleteAuthorizable.post.operation.description"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.service interface="org.apache.sling.jackrabbit.usermanager.DeleteUser"
  * @scr.service interface="org.apache.sling.jackrabbit.usermanager.DeleteGroup"
@@ -86,7 +87,7 @@ import org.apache.sling.servlets.post.SlingPostConstants;
  * @scr.property name="sling.servlet.methods" value="POST"
  * @scr.property name="sling.servlet.selectors" value="delete"
  */
-public class DeleteAuthorizableServlet extends AbstractAuthorizablePostServlet
+public class DeleteAuthorizableServlet extends AbstractPostServlet
 		implements DeleteUser, DeleteGroup, DeleteAuthorizables {
     private static final long serialVersionUID = 5874621724096106496L;
 
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java
index 461e8e7..6f36439 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java
@@ -76,7 +76,8 @@ import org.apache.sling.servlets.post.impl.helper.RequestProperty;
  * curl -Fprop1=value2 -Fproperty1=value1 http://localhost:8080/system/userManager/group/testGroup.update.html
  * </code>
  *
- * @scr.component metatype="no" immediate="true"
+ * @scr.component immediate="true" label="%updateGroup.post.operation.name"
+ *                description="%updateGroup.post.operation.description"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.service interface="org.apache.sling.jackrabbit.usermanager.UpdateGroup"
  * @scr.property name="sling.servlet.resourceTypes" values="sling/group"
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
index 13915a8..2142a4f 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
@@ -75,7 +75,8 @@ import org.apache.sling.servlets.post.impl.helper.RequestProperty;
  * 
  *
  *
- * @scr.component metatype="no" immediate="true"
+ * @scr.component immediate="true" label="%updateUser.post.operation.name"
+ *                description="%updateUser.post.operation.description"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.service interface="org.apache.sling.jackrabbit.usermanager.UpdateUser"
  * @scr.property name="sling.servlet.resourceTypes" value="sling/user"
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java
index a9d7a66..f5a5192 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java
@@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory;
  * Resource Provider implementation for jackrabbit UserManager resources.
  *
  * @scr.component immediate="true" label="%authorizable.resourceprovider.name"
- *                description="authorizable.resourceprovider.description"
+ *                description="%authorizable.resourceprovider.description"
  * @scr.property name="service.description"
  *               value="Resource provider implementation for UserManager resources"
  * @scr.property name="service.vendor" value="The Apache Software Foundation"
diff --git a/src/main/resources/OSGI-INF/metatype/metatype.properties b/src/main/resources/OSGI-INF/metatype/metatype.properties
index 597ece1..177a3f7 100644
--- a/src/main/resources/OSGI-INF/metatype/metatype.properties
+++ b/src/main/resources/OSGI-INF/metatype/metatype.properties
@@ -23,14 +23,36 @@
 # descriptions as used in the metatype.xml descriptor generated by the
 # the Sling SCR plugin
 
-authorizable.resourceprovider.name = Resolver for UserManager resources
+authorizable.resourceprovider.name = Apache Sling Resolver for UserManager resources
 authorizable.resourceprovider.description = Handles resolving resources for the \
  jackrabbit UserManager.
 
-createUser.post.operation.name = Create User Sling Post Operation
-createUser.post.operation.description = The Sling POST Operation to handle create user \
+createUser.post.operation.name = Apache Sling Create User
+createUser.post.operation.description = The Sling operation to handle create user \
  requests in Sling.
  
 self.registration.enabled.name = Self-Registration Enabled
 self.registration.enabled.description = When selected, the anonymous user is allowed to \
  register a new user with the system.
+
+ 
+changeUserPassword.post.operation.name = Apache Sling Change User Password
+changeUserPassword.post.operation.description = The Sling operation to handle change user \
+ password requests in Sling.
+ 
+createGroup.post.operation.name = Apache Sling Create Group
+createGroup.post.operation.description = The Sling operation to handle create group \
+ requests in Sling.
+
+updateUser.post.operation.name = Apache Sling Update User
+updateUser.post.operation.description = The Sling operation to handle update user \
+ requests in Sling.
+
+updateGroup.post.operation.name = Apache Sling Update Group
+updateGroup.post.operation.description = The Sling operation to handle update group \
+ requests in Sling.
+
+deleteAuthorizable.post.operation.name = Apache Sling Delete User/Group
+deleteAuthorizable.post.operation.description = The Sling operation to handle delete user \
+ or group requests in Sling.
+ 
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 08/24: SLING-2070 Members of the UserAdmin group can not create a new user

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 418e4bff6c2fcbc6493d6a64443a2668254f8783
Author: Eric Norman <en...@apache.org>
AuthorDate: Tue May 3 05:29:58 2011 +0000

    SLING-2070 Members of the UserAdmin group can not create a new user
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1098913 13f79535-47bb-0310-9956-ffa450edef68
---
 .../usermanager/impl/post/CreateUserServlet.java   | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)

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 34cf4c2..551a933 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
@@ -24,10 +24,12 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
 import org.apache.jackrabbit.api.security.user.Authorizable;
+import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.servlets.HtmlResponse;
+import org.apache.sling.commons.osgi.OsgiUtil;
 import org.apache.sling.servlets.post.impl.helper.RequestProperty;
 import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
 import org.apache.sling.jcr.api.SlingRepository;
@@ -105,6 +107,23 @@ public class CreateUserServlet extends AbstractUserPostServlet {
     private Boolean selfRegistrationEnabled = DEFAULT_SELF_REGISTRATION_ENABLED;
 
     /**
+     * The name of the configuration parameter providing the 
+     * 'User administrator' group name.
+     *
+     * @scr.property valueRef="DEFAULT_USER_ADMIN_GROUP_NAME"
+     */
+    private static final String PAR_USER_ADMIN_GROUP_NAME = "user.admin.group.name";
+
+    /**
+     * The default 'User administrator' group name
+     *
+     * @see #PAR_USER_ADMIN_GROUP_NAME
+     */
+    private static final String DEFAULT_USER_ADMIN_GROUP_NAME = "UserAdmin";
+ 
+    private String userAdminGroupName = DEFAULT_USER_ADMIN_GROUP_NAME;
+    
+    /**
      * The JCR Repository we access to resolve resources
      *
      * @scr.reference
@@ -155,6 +174,10 @@ public class CreateUserServlet extends AbstractUserPostServlet {
         } else {
             selfRegistrationEnabled = DEFAULT_SELF_REGISTRATION_ENABLED;
         }
+        
+        this.userAdminGroupName = OsgiUtil.toString(props.get(PAR_USER_ADMIN_GROUP_NAME),
+        		DEFAULT_USER_ADMIN_GROUP_NAME);
+        log.info("User Admin Group Name {}", this.userAdminGroupName);
     }
 
     /*
@@ -176,6 +199,18 @@ public class CreateUserServlet extends AbstractUserPostServlet {
             UserManager um = AccessControlUtil.getUserManager(currentSession);
             User currentUser = (User) um.getAuthorizable(currentSession.getUserID());
             administrator = currentUser.isAdmin();
+            
+            if (!administrator) {
+				//check if the user is a member of the 'User administrator' group
+				Authorizable userAdmin = um.getAuthorizable(this.userAdminGroupName);
+				if (userAdmin instanceof Group) {
+					boolean isMember = ((Group)userAdmin).isMember(currentUser);
+					if (isMember) {
+						administrator = true;
+					}
+				}
+            	
+            }
         } catch ( Exception ex ) {
             log.warn("Failed to determin if the user is an admin, assuming not. Cause: "+ex.getMessage());
             administrator = false;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 04/24: Use latest releases.

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit a8c3954ed1910b65cf0e991b1aa671090d802c76
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Dec 13 08:55:35 2010 +0000

    Use latest releases.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1045037 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 2608353..cea2e17 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>11-SNAPSHOT</version>
+        <version>10</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 23/24: [maven-release-plugin] prepare release org.apache.sling.jcr.jackrabbit.usermanager-2.2.0

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 67a0bab46e6319ab47bf5d0cf878f0816024f82f
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Fri Nov 11 18:09:37 2011 +0000

    [maven-release-plugin] prepare release org.apache.sling.jcr.jackrabbit.usermanager-2.2.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1201003 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index e0d231a..cd06b31 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.jcr.jackrabbit.usermanager</artifactId>
     <packaging>bundle</packaging>
-    <version>2.1.1-SNAPSHOT</version>
+    <version>2.2.0</version>
     <name>Apache Sling Jackrabbit UserManager Support</name>
     <description>
         Provides ResourceProvider and SlingPostOperations for the Jackrabbit
@@ -38,13 +38,13 @@
 
     <scm>
         <connection>
-            scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager
+            scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.jackrabbit.usermanager-2.2.0
         </connection>
         <developerConnection>
-            scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager
+            scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.jackrabbit.usermanager-2.2.0
         </developerConnection>
         <url>
-            http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-usermanager
+            http://svn.apache.org/viewvc/sling/tags/org.apache.sling.jcr.jackrabbit.usermanager-2.2.0
         </url>
     </scm>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 11/24: revert change from revision 1100034 that checked in by accident.

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit be7b76f4b17dc2aa4b3e84e89c5bbf391eaa5d5c
Author: Eric Norman <en...@apache.org>
AuthorDate: Fri May 6 04:29:01 2011 +0000

    revert change from revision 1100034 that checked in by accident.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1100046 13f79535-47bb-0310-9956-ffa450edef68
---
 .../usermanager/impl/AuthorizablePrivilegesInfoImpl.java         | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
index 48dfa38..f3fc51a 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
@@ -243,6 +243,15 @@ public class AuthorizablePrivilegesInfoImpl implements AuthorizablePrivilegesInf
 						return true;
 					}
 				}
+				
+				//check if the user is a member of the 'User administrator' group
+				Authorizable userAdmin = userManager.getAuthorizable(this.userAdminGroupName);
+				if (userAdmin instanceof Group) {
+					boolean isMember = ((Group)userAdmin).isMember(currentUser);
+					if (isMember) {
+						return true;
+					}
+				}
 			}
 		} catch (RepositoryException e) {
 			log.warn("Failed to determine if {} can remove authorizable {}", jcrSession.getUserID(), groupId);

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 20/24: tabs -> spaces

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit a8e4735fdaa9c6786239951100481aca76ddfe20
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Nov 10 21:21:44 2011 +0000

    tabs -> spaces
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1200559 13f79535-47bb-0310-9956-ffa450edef68
---
 .../usermanager/AuthorizablePrivilegesInfo.java    |  96 +++---
 .../jackrabbit/usermanager/ChangeUserPassword.java |  38 +-
 .../sling/jackrabbit/usermanager/CreateGroup.java  |  28 +-
 .../sling/jackrabbit/usermanager/CreateUser.java   |  38 +-
 .../usermanager/DeleteAuthorizables.java           |  28 +-
 .../sling/jackrabbit/usermanager/DeleteGroup.java  |  24 +-
 .../sling/jackrabbit/usermanager/DeleteUser.java   |  24 +-
 .../sling/jackrabbit/usermanager/UpdateGroup.java  |  30 +-
 .../sling/jackrabbit/usermanager/UpdateUser.java   |  28 +-
 .../impl/AuthorizablePrivilegesInfoImpl.java       | 384 ++++++++++-----------
 .../impl/post/AbstractAuthorizablePostServlet.java | 362 +++++++++----------
 .../impl/post/AbstractGroupPostServlet.java        |  42 +--
 .../usermanager/impl/post/AbstractPostServlet.java |  14 +-
 .../impl/post/ChangeUserPasswordServlet.java       |  74 ++--
 .../usermanager/impl/post/CreateGroupServlet.java  |  38 +-
 .../usermanager/impl/post/CreateUserServlet.java   |  84 ++---
 .../impl/post/DeleteAuthorizableServlet.java       |  96 +++---
 .../usermanager/impl/post/UpdateGroupServlet.java  |  44 +--
 .../usermanager/impl/post/UpdateUserServlet.java   |  44 +--
 19 files changed, 758 insertions(+), 758 deletions(-)

diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/AuthorizablePrivilegesInfo.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/AuthorizablePrivilegesInfo.java
index 39a0af3..c500dd8 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/AuthorizablePrivilegesInfo.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/AuthorizablePrivilegesInfo.java
@@ -20,55 +20,55 @@ import javax.jcr.Session;
 
 public interface AuthorizablePrivilegesInfo {
 
-	/**
-	 * Checks whether the current user has been granted privileges
-	 * to add a new user.
-	 *  
-	 * @param jcrSession the JCR session of the current user
-	 * @return true if the current user has the privileges, false otherwise
-	 */
-	boolean canAddUser(Session jcrSession);
+    /**
+     * Checks whether the current user has been granted privileges
+     * to add a new user.
+     *  
+     * @param jcrSession the JCR session of the current user
+     * @return true if the current user has the privileges, false otherwise
+     */
+    boolean canAddUser(Session jcrSession);
 
-	/**
-	 * Checks whether the current user has been granted privileges
-	 * to add a new group.
-	 *  
-	 * @param jcrSession the JCR session of the current user
-	 * @return true if the current user has the privileges, false otherwise
-	 */
-	boolean canAddGroup(Session jcrSession);
-	
-	/**
-	 * Checks whether the current user has been granted privileges
-	 * to update the properties of the specified user or group.
-	 *  
-	 * @param jcrSession the JCR session of the current user
-	 * @param principalId the user or group id to check
-	 * @return true if the current user has the privileges, false otherwise
-	 */
-	boolean canUpdateProperties(Session jcrSession,
-			String principalId);
+    /**
+     * Checks whether the current user has been granted privileges
+     * to add a new group.
+     *  
+     * @param jcrSession the JCR session of the current user
+     * @return true if the current user has the privileges, false otherwise
+     */
+    boolean canAddGroup(Session jcrSession);
+    
+    /**
+     * Checks whether the current user has been granted privileges
+     * to update the properties of the specified user or group.
+     *  
+     * @param jcrSession the JCR session of the current user
+     * @param principalId the user or group id to check
+     * @return true if the current user has the privileges, false otherwise
+     */
+    boolean canUpdateProperties(Session jcrSession,
+            String principalId);
 
-	/**
-	 * Checks whether the current user has been granted privileges
-	 * to remove the specified user or group.
-	 *  
-	 * @param jcrSession the JCR session of the current user
-	 * @param principalId the user or group id to check
-	 * @return true if the current user has the privileges, false otherwise
-	 */
-	boolean canRemove(Session jcrSession,
-			String principalId);
-	
-	/**
-	 * Checks whether the current user has been granted privileges
-	 * to update the membership of the specified group.
-	 *  
-	 * @param jcrSession the JCR session of the current user
-	 * @param groupId the group id to check
-	 * @return true if the current user has the privileges, false otherwise
-	 */
-	boolean canUpdateGroupMembers(Session jcrSession,
-			String groupId);
+    /**
+     * Checks whether the current user has been granted privileges
+     * to remove the specified user or group.
+     *  
+     * @param jcrSession the JCR session of the current user
+     * @param principalId the user or group id to check
+     * @return true if the current user has the privileges, false otherwise
+     */
+    boolean canRemove(Session jcrSession,
+            String principalId);
+    
+    /**
+     * Checks whether the current user has been granted privileges
+     * to update the membership of the specified group.
+     *  
+     * @param jcrSession the JCR session of the current user
+     * @param groupId the group id to check
+     * @return true if the current user has the privileges, false otherwise
+     */
+    boolean canUpdateGroupMembers(Session jcrSession,
+            String groupId);
 
 }
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/ChangeUserPassword.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/ChangeUserPassword.java
index d98f676..16d1513 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/ChangeUserPassword.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/ChangeUserPassword.java
@@ -35,24 +35,24 @@ import org.apache.sling.servlets.post.Modification;
  */
 public interface ChangeUserPassword {
 
-	/**
-	 * Update the password of a user in the repository
-	 * 
-	 * @param jcrSession the JCR session of the user updating the user
-	 * @param name The name of the user to update (required)
-	 * @param oldPassword The current password of the user (required for non-admin users)
-	 * @param newPassword The password value to apply (required)
-	 * @param newPasswordConfirm The password value to apply again (required)
+    /**
+     * Update the password of a user in the repository
+     * 
+     * @param jcrSession the JCR session of the user updating the user
+     * @param name The name of the user to update (required)
+     * @param oldPassword The current password of the user (required for non-admin users)
+     * @param newPassword The password value to apply (required)
+     * @param newPasswordConfirm The password value to apply again (required)
      * @param changes The list of changes for this operation (optional)
-	 * @return the user whose password was changed
-	 * @throws RepositoryException
-	 */
-	public User changePassword(Session jcrSession,
-							String name,
-							String oldPassword,
-							String newPassword,
-							String newPasswordConfirm,
-							List<Modification> changes
-				) throws RepositoryException;
-	
+     * @return the user whose password was changed
+     * @throws RepositoryException
+     */
+    public User changePassword(Session jcrSession,
+                            String name,
+                            String oldPassword,
+                            String newPassword,
+                            String newPasswordConfirm,
+                            List<Modification> changes
+                ) throws RepositoryException;
+    
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateGroup.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateGroup.java
index 934e502..56ddf46 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateGroup.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateGroup.java
@@ -36,20 +36,20 @@ import org.apache.sling.servlets.post.Modification;
  */
 public interface CreateGroup {
 
-	/**
-	 * Create a new group for the repository
-	 * 
-	 * @param jcrSession the JCR session of the user creating the group
-	 * @param name The name of the new group (required)
-	 * @param properties Extra properties to update on the group.  The entry values should be either a String or String[] (optional)
+    /**
+     * Create a new group for the repository
+     * 
+     * @param jcrSession the JCR session of the user creating the group
+     * @param name The name of the new group (required)
+     * @param properties Extra properties to update on the group.  The entry values should be either a String or String[] (optional)
      * @param changes The list of changes for this operation (optional)
      * @return the group that was created
-	 * @throws RepositoryException
-	 */
-	public Group createGroup(Session jcrSession,
-							String name,
-							Map<String, ?> properties,
-							List<Modification> changes
-				) throws RepositoryException;
-	
+     * @throws RepositoryException
+     */
+    public Group createGroup(Session jcrSession,
+                            String name,
+                            Map<String, ?> properties,
+                            List<Modification> changes
+                ) throws RepositoryException;
+    
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateUser.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateUser.java
index 51c7b02..a0de69a 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateUser.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateUser.java
@@ -36,24 +36,24 @@ import org.apache.sling.servlets.post.Modification;
  */
 public interface CreateUser {
 
-	/**
-	 * Create a new user for the repository
-	 * 
-	 * @param jcrSession the JCR session of the user creating the user
-	 * @param name The name of the new user (required)
-	 * @param password The password of the new user (required)
-	 * @param password The password of the new user again (required)
-	 * @param properties Extra properties to update on the user.  The entry values should be either a String or String[] (optional)
+    /**
+     * Create a new user for the repository
+     * 
+     * @param jcrSession the JCR session of the user creating the user
+     * @param name The name of the new user (required)
+     * @param password The password of the new user (required)
+     * @param password The password of the new user again (required)
+     * @param properties Extra properties to update on the user.  The entry values should be either a String or String[] (optional)
      * @param changes The list of changes for this operation (optional)
-	 * @return the user that was created
-	 * @throws RepositoryException
-	 */
-	public User createUser(Session jcrSession,
-							String name,
-							String password,
-							String passwordConfirm,
-							Map<String, ?> properties,
-							List<Modification> changes
-				) throws RepositoryException;
-	
+     * @return the user that was created
+     * @throws RepositoryException
+     */
+    public User createUser(Session jcrSession,
+                            String name,
+                            String password,
+                            String passwordConfirm,
+                            Map<String, ?> properties,
+                            List<Modification> changes
+                ) throws RepositoryException;
+    
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteAuthorizables.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteAuthorizables.java
index 98f93bf..d6f3e0c 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteAuthorizables.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteAuthorizables.java
@@ -35,19 +35,19 @@ import org.apache.sling.servlets.post.Modification;
  */
 public interface DeleteAuthorizables {
 
-	/**
-	 * Deletes one or more users or groups from the repository
-	 * 
-	 * @param jcrSession the JCR session of the user creating the user
-	 * @param baseResource the base resource to calculate the relative paths from (required)
-	 * @param paths An array of relative resource paths to Authorizables to be deleted (required)
+    /**
+     * Deletes one or more users or groups from the repository
+     * 
+     * @param jcrSession the JCR session of the user creating the user
+     * @param baseResource the base resource to calculate the relative paths from (required)
+     * @param paths An array of relative resource paths to Authorizables to be deleted (required)
      * @param changes The list of changes for this operation (optional)
-	 * @throws RepositoryException
-	 */
-	public void deleteAuthorizables(Session jcrSession,
-							Resource baseResource,
-							String [] paths,
-							List<Modification> changes
-				) throws RepositoryException;
-	
+     * @throws RepositoryException
+     */
+    public void deleteAuthorizables(Session jcrSession,
+                            Resource baseResource,
+                            String [] paths,
+                            List<Modification> changes
+                ) throws RepositoryException;
+    
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteGroup.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteGroup.java
index 3c9f9b1..be3b30a 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteGroup.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteGroup.java
@@ -34,17 +34,17 @@ import org.apache.sling.servlets.post.Modification;
  */
 public interface DeleteGroup {
 
-	/**
-	 * Deletes a group from the repository
-	 * 
-	 * @param jcrSession the JCR session of the user creating the user
-	 * @param name The name of the group to delete (required)
+    /**
+     * Deletes a group from the repository
+     * 
+     * @param jcrSession the JCR session of the user creating the user
+     * @param name The name of the group to delete (required)
      * @param changes The list of changes for this operation (optional)
-	 * @throws RepositoryException
-	 */
-	public void deleteGroup(Session jcrSession,
-							String name,
-							List<Modification> changes
-				) throws RepositoryException;
-	
+     * @throws RepositoryException
+     */
+    public void deleteGroup(Session jcrSession,
+                            String name,
+                            List<Modification> changes
+                ) throws RepositoryException;
+    
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteUser.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteUser.java
index 506ae79..177c64f 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteUser.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteUser.java
@@ -34,17 +34,17 @@ import org.apache.sling.servlets.post.Modification;
  */
 public interface DeleteUser {
 
-	/**
-	 * Deletes a user from the repository
-	 * 
-	 * @param jcrSession the JCR session of the user creating the user
-	 * @param name The name of the user to delete (required)
+    /**
+     * Deletes a user from the repository
+     * 
+     * @param jcrSession the JCR session of the user creating the user
+     * @param name The name of the user to delete (required)
      * @param changes The list of changes for this operation (optional)
-	 * @throws RepositoryException
-	 */
-	public void deleteUser(Session jcrSession,
-							String name,
-							List<Modification> changes
-				) throws RepositoryException;
-	
+     * @throws RepositoryException
+     */
+    public void deleteUser(Session jcrSession,
+                            String name,
+                            List<Modification> changes
+                ) throws RepositoryException;
+    
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateGroup.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateGroup.java
index 64bdacd..ccc019c 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateGroup.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateGroup.java
@@ -36,20 +36,20 @@ import org.apache.sling.servlets.post.Modification;
  */
 public interface UpdateGroup {
 
-	/**
-	 * Update a group in the repository
-	 * 
-	 * @param jcrSession the JCR session of the user creating the group
-	 * @param name The name of the group to update (required)
-	 * @param properties Extra properties to update on the group.  The entry values should be either a String or String[] (optional)
+    /**
+     * Update a group in the repository
+     * 
+     * @param jcrSession the JCR session of the user creating the group
+     * @param name The name of the group to update (required)
+     * @param properties Extra properties to update on the group.  The entry values should be either a String or String[] (optional)
      * @param changes The list of changes for this operation (optional)
-	 * @return the group that was updated or null if not found
-	 * @throws RepositoryException
-	 */
-	public Group updateGroup(Session jcrSession,
-							String name,
-							Map<String, ?> properties,
-							List<Modification> changes
-				) throws RepositoryException;
-	
+     * @return the group that was updated or null if not found
+     * @throws RepositoryException
+     */
+    public Group updateGroup(Session jcrSession,
+                            String name,
+                            Map<String, ?> properties,
+                            List<Modification> changes
+                ) throws RepositoryException;
+    
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateUser.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateUser.java
index aac6a0a..5b19f89 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateUser.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateUser.java
@@ -36,20 +36,20 @@ import org.apache.sling.servlets.post.Modification;
  */
 public interface UpdateUser {
 
-	/**
-	 * Update a user in the repository
-	 * 
-	 * @param jcrSession the JCR session of the user updating the user
-	 * @param name The name of the user to update (required)
-	 * @param properties Extra properties to update on the user. The entry values should be either a String or String[] (optional)
+    /**
+     * Update a user in the repository
+     * 
+     * @param jcrSession the JCR session of the user updating the user
+     * @param name The name of the user to update (required)
+     * @param properties Extra properties to update on the user. The entry values should be either a String or String[] (optional)
      * @param changes The list of changes for this operation (optional)
      * @return the user that was updated or null if not found 
-	 * @throws RepositoryException
-	 */
-	public User updateUser(Session jcrSession,
-							String name,
-							Map<String, ?> properties,
-							List<Modification> changes
-				) throws RepositoryException;
-	
+     * @throws RepositoryException
+     */
+    public User updateUser(Session jcrSession,
+                            String name,
+                            Map<String, ?> properties,
+                            List<Modification> changes
+                ) throws RepositoryException;
+    
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
index f3fc51a..435563c 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
@@ -106,207 +106,207 @@ public class AuthorizablePrivilegesInfoImpl implements AuthorizablePrivilegesInf
     private String groupAdminGroupName = DEFAULT_GROUP_ADMIN_GROUP_NAME;
     
     
-	/* (non-Javadoc)
-	 * @see org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo#canAddGroup(javax.jcr.Session)
-	 */
-	public boolean canAddGroup(Session jcrSession) {
-		try {
-			UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
-			Authorizable currentUser = userManager.getAuthorizable(jcrSession.getUserID());
+    /* (non-Javadoc)
+     * @see org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo#canAddGroup(javax.jcr.Session)
+     */
+    public boolean canAddGroup(Session jcrSession) {
+        try {
+            UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
+            Authorizable currentUser = userManager.getAuthorizable(jcrSession.getUserID());
 
-			if (currentUser != null) {
-				if (((User)currentUser).isAdmin()) {
-					return true; //admin user has full control
-				}
-				
-				//check if the user is a member of the 'Group administrator' group
-				Authorizable groupAdmin = userManager.getAuthorizable(this.groupAdminGroupName);
-				if (groupAdmin instanceof Group) {
-					boolean isMember = ((Group)groupAdmin).isMember(currentUser);
-					if (isMember) {
-						return true;
-					}
-				}
-			}
-		} catch (RepositoryException e) {
-			log.warn("Failed to determine if {} can add a new group", jcrSession.getUserID());
-		}
-		return false;
-	}
+            if (currentUser != null) {
+                if (((User)currentUser).isAdmin()) {
+                    return true; //admin user has full control
+                }
+                
+                //check if the user is a member of the 'Group administrator' group
+                Authorizable groupAdmin = userManager.getAuthorizable(this.groupAdminGroupName);
+                if (groupAdmin instanceof Group) {
+                    boolean isMember = ((Group)groupAdmin).isMember(currentUser);
+                    if (isMember) {
+                        return true;
+                    }
+                }
+            }
+        } catch (RepositoryException e) {
+            log.warn("Failed to determine if {} can add a new group", jcrSession.getUserID());
+        }
+        return false;
+    }
 
-	/* (non-Javadoc)
-	 * @see org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo#canAddUser(javax.jcr.Session)
-	 */
-	public boolean canAddUser(Session jcrSession) {
-		try {
-			//if self-registration is enabled, then anyone can create a user
-			if (componentContext != null) {
-				String filter = "(&(sling.servlet.resourceTypes=sling/users)(|(sling.servlet.methods=POST)(sling.servlet.selectors=create)))";
-				BundleContext bundleContext = componentContext.getBundleContext();
-				ServiceReference[] serviceReferences = bundleContext.getServiceReferences(Servlet.class.getName(), filter);
-				if (serviceReferences != null) {
-					String propName = "self.registration.enabled";
-					for (ServiceReference serviceReference : serviceReferences) {
-						Object propValue = serviceReference.getProperty(propName);
-						if (propValue != null) {
-							boolean selfRegEnabled = Boolean.TRUE.equals(propValue);
-							if (selfRegEnabled) {
-								return true;
-							}
-							break;
-						}
-					}
-				}
-			}
+    /* (non-Javadoc)
+     * @see org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo#canAddUser(javax.jcr.Session)
+     */
+    public boolean canAddUser(Session jcrSession) {
+        try {
+            //if self-registration is enabled, then anyone can create a user
+            if (componentContext != null) {
+                String filter = "(&(sling.servlet.resourceTypes=sling/users)(|(sling.servlet.methods=POST)(sling.servlet.selectors=create)))";
+                BundleContext bundleContext = componentContext.getBundleContext();
+                ServiceReference[] serviceReferences = bundleContext.getServiceReferences(Servlet.class.getName(), filter);
+                if (serviceReferences != null) {
+                    String propName = "self.registration.enabled";
+                    for (ServiceReference serviceReference : serviceReferences) {
+                        Object propValue = serviceReference.getProperty(propName);
+                        if (propValue != null) {
+                            boolean selfRegEnabled = Boolean.TRUE.equals(propValue);
+                            if (selfRegEnabled) {
+                                return true;
+                            }
+                            break;
+                        }
+                    }
+                }
+            }
 
-			UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
-			Authorizable currentUser = userManager.getAuthorizable(jcrSession.getUserID());
-			if (currentUser != null) {
-				if (((User)currentUser).isAdmin()) {
-					return true; //admin user has full control
-				}
-				
-				//check if the user is a member of the 'User administrator' group
-				Authorizable userAdmin = userManager.getAuthorizable(this.userAdminGroupName);
-				if (userAdmin instanceof Group) {
-					boolean isMember = ((Group)userAdmin).isMember(currentUser);
-					if (isMember) {
-						return true;
-					}
-				}
-			}
-		} catch (RepositoryException e) {
-			log.warn("Failed to determine if {} can add a new user", jcrSession.getUserID());
-		} catch (InvalidSyntaxException e) {
-			log.warn("Failed to determine if {} can add a new user", jcrSession.getUserID());
-		}
-		return false;
-	}
+            UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
+            Authorizable currentUser = userManager.getAuthorizable(jcrSession.getUserID());
+            if (currentUser != null) {
+                if (((User)currentUser).isAdmin()) {
+                    return true; //admin user has full control
+                }
+                
+                //check if the user is a member of the 'User administrator' group
+                Authorizable userAdmin = userManager.getAuthorizable(this.userAdminGroupName);
+                if (userAdmin instanceof Group) {
+                    boolean isMember = ((Group)userAdmin).isMember(currentUser);
+                    if (isMember) {
+                        return true;
+                    }
+                }
+            }
+        } catch (RepositoryException e) {
+            log.warn("Failed to determine if {} can add a new user", jcrSession.getUserID());
+        } catch (InvalidSyntaxException e) {
+            log.warn("Failed to determine if {} can add a new user", jcrSession.getUserID());
+        }
+        return false;
+    }
 
-	/* (non-Javadoc)
-	 * @see org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo#canRemove(javax.jcr.Session, java.lang.String)
-	 */
-	public boolean canRemove(Session jcrSession, String principalId) {
-		try {
-			UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
-			Authorizable currentUser = userManager.getAuthorizable(jcrSession.getUserID());
+    /* (non-Javadoc)
+     * @see org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo#canRemove(javax.jcr.Session, java.lang.String)
+     */
+    public boolean canRemove(Session jcrSession, String principalId) {
+        try {
+            UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
+            Authorizable currentUser = userManager.getAuthorizable(jcrSession.getUserID());
 
-			if (((User)currentUser).isAdmin()) {
-				return true; //admin user has full control
-			}
+            if (((User)currentUser).isAdmin()) {
+                return true; //admin user has full control
+            }
 
-			Authorizable authorizable = userManager.getAuthorizable(principalId);
-			if (authorizable instanceof User) {
-				//check if the user is a member of the 'User administrator' group
-				Authorizable userAdmin = userManager.getAuthorizable(this.userAdminGroupName);
-				if (userAdmin instanceof Group) {
-					boolean isMember = ((Group)userAdmin).isMember(currentUser);
-					if (isMember) {
-						return true;
-					}
-				}
-			} else if (authorizable instanceof Group) {
-				//check if the user is a member of the 'Group administrator' group
-				Authorizable groupAdmin = userManager.getAuthorizable(this.groupAdminGroupName);
-				if (groupAdmin instanceof Group) {
-					boolean isMember = ((Group)groupAdmin).isMember(currentUser);
-					if (isMember) {
-						return true;
-					}
-				}
-			}
-		} catch (RepositoryException e) {
-			log.warn("Failed to determine if {} can remove authorizable {}", jcrSession.getUserID(), principalId);
-		}
-		return false;
-	}
+            Authorizable authorizable = userManager.getAuthorizable(principalId);
+            if (authorizable instanceof User) {
+                //check if the user is a member of the 'User administrator' group
+                Authorizable userAdmin = userManager.getAuthorizable(this.userAdminGroupName);
+                if (userAdmin instanceof Group) {
+                    boolean isMember = ((Group)userAdmin).isMember(currentUser);
+                    if (isMember) {
+                        return true;
+                    }
+                }
+            } else if (authorizable instanceof Group) {
+                //check if the user is a member of the 'Group administrator' group
+                Authorizable groupAdmin = userManager.getAuthorizable(this.groupAdminGroupName);
+                if (groupAdmin instanceof Group) {
+                    boolean isMember = ((Group)groupAdmin).isMember(currentUser);
+                    if (isMember) {
+                        return true;
+                    }
+                }
+            }
+        } catch (RepositoryException e) {
+            log.warn("Failed to determine if {} can remove authorizable {}", jcrSession.getUserID(), principalId);
+        }
+        return false;
+    }
 
-	/* (non-Javadoc)
-	 * @see org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo#canUpdateGroupMembers(javax.jcr.Session, java.lang.String)
-	 */
-	public boolean canUpdateGroupMembers(Session jcrSession, String groupId) {
-		try {
-			UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
-			Authorizable currentUser = userManager.getAuthorizable(jcrSession.getUserID());
+    /* (non-Javadoc)
+     * @see org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo#canUpdateGroupMembers(javax.jcr.Session, java.lang.String)
+     */
+    public boolean canUpdateGroupMembers(Session jcrSession, String groupId) {
+        try {
+            UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
+            Authorizable currentUser = userManager.getAuthorizable(jcrSession.getUserID());
 
-			if (((User)currentUser).isAdmin()) {
-				return true; //admin user has full control
-			}
+            if (((User)currentUser).isAdmin()) {
+                return true; //admin user has full control
+            }
 
-			Authorizable authorizable = userManager.getAuthorizable(groupId);
-			if (authorizable instanceof Group) {
-				//check if the user is a member of the 'Group administrator' group
-				Authorizable groupAdmin = userManager.getAuthorizable(this.groupAdminGroupName);
-				if (groupAdmin instanceof Group) {
-					boolean isMember = ((Group)groupAdmin).isMember(currentUser);
-					if (isMember) {
-						return true;
-					}
-				}
-				
-				//check if the user is a member of the 'User administrator' group
-				Authorizable userAdmin = userManager.getAuthorizable(this.userAdminGroupName);
-				if (userAdmin instanceof Group) {
-					boolean isMember = ((Group)userAdmin).isMember(currentUser);
-					if (isMember) {
-						return true;
-					}
-				}
-			}
-		} catch (RepositoryException e) {
-			log.warn("Failed to determine if {} can remove authorizable {}", jcrSession.getUserID(), groupId);
-		}
-		return false;
-	}
+            Authorizable authorizable = userManager.getAuthorizable(groupId);
+            if (authorizable instanceof Group) {
+                //check if the user is a member of the 'Group administrator' group
+                Authorizable groupAdmin = userManager.getAuthorizable(this.groupAdminGroupName);
+                if (groupAdmin instanceof Group) {
+                    boolean isMember = ((Group)groupAdmin).isMember(currentUser);
+                    if (isMember) {
+                        return true;
+                    }
+                }
+                
+                //check if the user is a member of the 'User administrator' group
+                Authorizable userAdmin = userManager.getAuthorizable(this.userAdminGroupName);
+                if (userAdmin instanceof Group) {
+                    boolean isMember = ((Group)userAdmin).isMember(currentUser);
+                    if (isMember) {
+                        return true;
+                    }
+                }
+            }
+        } catch (RepositoryException e) {
+            log.warn("Failed to determine if {} can remove authorizable {}", jcrSession.getUserID(), groupId);
+        }
+        return false;
+    }
 
-	/* (non-Javadoc)
-	 * @see org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo#canUpdateProperties(javax.jcr.Session, java.lang.String)
-	 */
-	public boolean canUpdateProperties(Session jcrSession, String principalId) {
-		try {
-			if (jcrSession.getUserID().equals(principalId)) {
-				//user is allowed to update it's own properties
-				return true;
-			}
-			
-			UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
-			Authorizable currentUser = userManager.getAuthorizable(jcrSession.getUserID());
+    /* (non-Javadoc)
+     * @see org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo#canUpdateProperties(javax.jcr.Session, java.lang.String)
+     */
+    public boolean canUpdateProperties(Session jcrSession, String principalId) {
+        try {
+            if (jcrSession.getUserID().equals(principalId)) {
+                //user is allowed to update it's own properties
+                return true;
+            }
+            
+            UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
+            Authorizable currentUser = userManager.getAuthorizable(jcrSession.getUserID());
 
-			if (((User)currentUser).isAdmin()) {
-				return true; //admin user has full control
-			}
+            if (((User)currentUser).isAdmin()) {
+                return true; //admin user has full control
+            }
 
-			Authorizable authorizable = userManager.getAuthorizable(principalId);
-			if (authorizable instanceof User) {
-				//check if the user is a member of the 'User administrator' group
-				Authorizable userAdmin = userManager.getAuthorizable(this.userAdminGroupName);
-				if (userAdmin instanceof Group) {
-					boolean isMember = ((Group)userAdmin).isMember(currentUser);
-					if (isMember) {
-						return true;
-					}
-				}
-			} else if (authorizable instanceof Group) {
-				//check if the user is a member of the 'Group administrator' group
-				Authorizable groupAdmin = userManager.getAuthorizable(this.groupAdminGroupName);
-				if (groupAdmin instanceof Group) {
-					boolean isMember = ((Group)groupAdmin).isMember(currentUser);
-					if (isMember) {
-						return true;
-					}
-				}
-			}
-		} catch (RepositoryException e) {
-			log.warn("Failed to determine if {} can remove authorizable {}", jcrSession.getUserID(), principalId);
-		}
-		return false;
-	}
+            Authorizable authorizable = userManager.getAuthorizable(principalId);
+            if (authorizable instanceof User) {
+                //check if the user is a member of the 'User administrator' group
+                Authorizable userAdmin = userManager.getAuthorizable(this.userAdminGroupName);
+                if (userAdmin instanceof Group) {
+                    boolean isMember = ((Group)userAdmin).isMember(currentUser);
+                    if (isMember) {
+                        return true;
+                    }
+                }
+            } else if (authorizable instanceof Group) {
+                //check if the user is a member of the 'Group administrator' group
+                Authorizable groupAdmin = userManager.getAuthorizable(this.groupAdminGroupName);
+                if (groupAdmin instanceof Group) {
+                    boolean isMember = ((Group)groupAdmin).isMember(currentUser);
+                    if (isMember) {
+                        return true;
+                    }
+                }
+            }
+        } catch (RepositoryException e) {
+            log.warn("Failed to determine if {} can remove authorizable {}", jcrSession.getUserID(), principalId);
+        }
+        return false;
+    }
 
 
-	// ---------- SCR Integration ----------------------------------------------
+    // ---------- SCR Integration ----------------------------------------------
 
-	//keep track of the bundle context
-	private ComponentContext componentContext;
+    //keep track of the bundle context
+    private ComponentContext componentContext;
 
     /**
      * Called by SCR to activate the component.
@@ -320,21 +320,21 @@ public class AuthorizablePrivilegesInfoImpl implements AuthorizablePrivilegesInf
             throws InvalidKeyException, NoSuchAlgorithmException,
             IllegalStateException, UnsupportedEncodingException {
 
-    	this.componentContext = componentContext;
-    	
+        this.componentContext = componentContext;
+        
         Dictionary<?, ?> properties = componentContext.getProperties();
 
         this.userAdminGroupName = OsgiUtil.toString(properties.get(PAR_USER_ADMIN_GROUP_NAME),
-        		DEFAULT_USER_ADMIN_GROUP_NAME);
+                DEFAULT_USER_ADMIN_GROUP_NAME);
         log.info("User Admin Group Name {}", this.userAdminGroupName);
 
         this.groupAdminGroupName = OsgiUtil.toString(properties.get(PAR_GROUP_ADMIN_GROUP_NAME), 
-        		DEFAULT_GROUP_ADMIN_GROUP_NAME);
+                DEFAULT_GROUP_ADMIN_GROUP_NAME);
         log.info("Group Admin Group Name {}", this.groupAdminGroupName);
     }
 
     protected void deactivate(ComponentContext componentContext) {
-    	this.userAdminGroupName = DEFAULT_USER_ADMIN_GROUP_NAME;
-    	this.groupAdminGroupName = DEFAULT_GROUP_ADMIN_GROUP_NAME;
+        this.userAdminGroupName = DEFAULT_USER_ADMIN_GROUP_NAME;
+        this.groupAdminGroupName = DEFAULT_GROUP_ADMIN_GROUP_NAME;
     }
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java
index 40f6a96..08c97b4 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java
@@ -138,7 +138,7 @@ public abstract class AbstractAuthorizablePostServlet extends
 
                 String typeHintValue = convertToString(e.getValue());
                 if (typeHintValue != null) {
-                	prop.setTypeHintValue(typeHintValue);
+                    prop.setTypeHintValue(typeHintValue);
                 }
 
                 continue;
@@ -508,186 +508,186 @@ public abstract class AbstractAuthorizablePostServlet extends
     }
 
     
-	protected String convertToString(Object obj) {
-		if (obj == null) {
-			return null;
-		}
-		
-		if (obj instanceof String) {
-			return (String)obj;
-		} else if (obj instanceof String[]) {
-			String [] values = (String[])obj;
-			if (values.length > 0) {
-				return values[0];
-			}
-			return null;
-		} else if (obj instanceof RequestParameter) {
-			((RequestParameter)obj).getString();
-		} else if (obj instanceof RequestParameter[]) {
-			RequestParameter[] values = (RequestParameter[])obj;
-			if (values.length > 0) {
-				return values[0].getString();
-			}
-			return null;
-		}
-		return null;
-	}
+    protected String convertToString(Object obj) {
+        if (obj == null) {
+            return null;
+        }
+        
+        if (obj instanceof String) {
+            return (String)obj;
+        } else if (obj instanceof String[]) {
+            String [] values = (String[])obj;
+            if (values.length > 0) {
+                return values[0];
+            }
+            return null;
+        } else if (obj instanceof RequestParameter) {
+            ((RequestParameter)obj).getString();
+        } else if (obj instanceof RequestParameter[]) {
+            RequestParameter[] values = (RequestParameter[])obj;
+            if (values.length > 0) {
+                return values[0].getString();
+            }
+            return null;
+        }
+        return null;
+    }
+    
+    protected String[] convertToStringArray(Object obj) {
+        if (obj == null) {
+            return null;
+        }
+        
+        if (obj instanceof String) {
+            return new String[] {(String)obj};
+        } else if (obj instanceof String[]) {
+            return (String[])obj;
+        } else if (obj instanceof RequestParameter) {
+            return new String[] {((RequestParameter)obj).getString()};
+        } else if (obj instanceof RequestParameter[]) {
+            RequestParameter[] values = (RequestParameter[])obj;
+            String [] strValues = new String[values.length];
+            for (int i=0; i < values.length; i++) {
+                strValues[i] = values[i].getString();
+            }
+            return strValues;
+        }
+        return null;
+    }
+
+    protected RequestParameter[] convertToRequestParameterArray(Object obj) {
+        if (obj == null) {
+            return null;
+        }
+        
+        if (obj instanceof String) {
+            return new RequestParameter[] {
+                new RequestParameterImpl((String)obj, null) 
+            };
+        } else if (obj instanceof String[]) {
+            String [] strValues = (String[])obj;
+            RequestParameter [] values = new RequestParameter[strValues.length];
+            for (int i=0; i < strValues.length; i++) {
+                values[i] = new RequestParameterImpl(strValues[i], null);
+            }
+            return values;
+        } else if (obj instanceof RequestParameter) {
+            return new RequestParameter[] {(RequestParameter)obj};
+        } else if (obj instanceof RequestParameter[]) {
+            return (RequestParameter[])obj;
+        }
+        return null;
+    }
+    
+    static class RequestParameterImpl implements RequestParameter {
+
+        private String value;
+        private String encoding;
+
+        private byte[] content;
+
+        RequestParameterImpl(String value, String encoding) {
+            this.encoding = encoding;
+            this.value = value;
+            this.content = null;
+        }
+
+        String getEncoding() {
+            return this.encoding;
+        }
+        
+        void setEncoding(String encoding) {
+            // recode this parameter by encoding the string with the current
+            // encoding and decode the bytes with the encoding
+            try {
+                this.value = getString(encoding);
+            } catch (UnsupportedEncodingException uee) {
+                throw new SlingUnsupportedEncodingException(uee);
+            }
+            this.encoding = encoding;
+        }
+
+        /**
+         * @see org.apache.sling.api.request.RequestParameter#get()
+         */
+        public byte[] get() {
+            if (content == null) {
+                try {
+                    content = getString().getBytes(getEncoding());
+                } catch (Exception e) {
+                    // UnsupportedEncodingException, IllegalArgumentException
+                    content = getString().getBytes();
+                }
+            }
+            return content;
+        }
+
+        /**
+         * @see org.apache.sling.api.request.RequestParameter#getContentType()
+         */
+        public String getContentType() {
+            // none known for www-form-encoded parameters
+            return null;
+        }
+
+        /**
+         * @see org.apache.sling.api.request.RequestParameter#getInputStream()
+         */
+        public InputStream getInputStream() {
+            return new ByteArrayInputStream(this.get());
+        }
+
+        /**
+         * @see org.apache.sling.api.request.RequestParameter#getFileName()
+         */
+        public String getFileName() {
+            // no original file name
+            return null;
+        }
+
+        /**
+         * @see org.apache.sling.api.request.RequestParameter#getSize()
+         */
+        public long getSize() {
+            return this.get().length;
+        }
+
+        /**
+         * @see org.apache.sling.api.request.RequestParameter#getString()
+         */
+        public String getString() {
+            return value;
+        }
+
+        /**
+         * @see org.apache.sling.api.request.RequestParameter#getString(java.lang.String)
+         */
+        public String getString(String encoding)
+                throws UnsupportedEncodingException {
+            return new String(this.get(), encoding);
+        }
+
+        /**
+         * @see org.apache.sling.api.request.RequestParameter#isFormField()
+         */
+        public boolean isFormField() {
+            // www-form-encoded are always form fields
+            return true;
+        }
+
+        public String toString() {
+            return this.getString();
+        }
+    }
     
-	protected String[] convertToStringArray(Object obj) {
-		if (obj == null) {
-			return null;
-		}
-		
-		if (obj instanceof String) {
-			return new String[] {(String)obj};
-		} else if (obj instanceof String[]) {
-			return (String[])obj;
-		} else if (obj instanceof RequestParameter) {
-			return new String[] {((RequestParameter)obj).getString()};
-		} else if (obj instanceof RequestParameter[]) {
-			RequestParameter[] values = (RequestParameter[])obj;
-			String [] strValues = new String[values.length];
-			for (int i=0; i < values.length; i++) {
-				strValues[i] = values[i].getString();
-			}
-			return strValues;
-		}
-		return null;
-	}
-
-	protected RequestParameter[] convertToRequestParameterArray(Object obj) {
-		if (obj == null) {
-			return null;
-		}
-		
-		if (obj instanceof String) {
-			return new RequestParameter[] {
-				new RequestParameterImpl((String)obj, null)	
-			};
-		} else if (obj instanceof String[]) {
-			String [] strValues = (String[])obj;
-			RequestParameter [] values = new RequestParameter[strValues.length];
-			for (int i=0; i < strValues.length; i++) {
-				values[i] = new RequestParameterImpl(strValues[i], null);
-			}
-			return values;
-		} else if (obj instanceof RequestParameter) {
-			return new RequestParameter[] {(RequestParameter)obj};
-		} else if (obj instanceof RequestParameter[]) {
-			return (RequestParameter[])obj;
-		}
-		return null;
-	}
-	
-	static class RequestParameterImpl implements RequestParameter {
-
-	    private String value;
-	    private String encoding;
-
-	    private byte[] content;
-
-	    RequestParameterImpl(String value, String encoding) {
-	    	this.encoding = encoding;
-	        this.value = value;
-	        this.content = null;
-	    }
-
-	    String getEncoding() {
-	        return this.encoding;
-	    }
-	    
-	    void setEncoding(String encoding) {
-	        // recode this parameter by encoding the string with the current
-	        // encoding and decode the bytes with the encoding
-	        try {
-	            this.value = getString(encoding);
-	        } catch (UnsupportedEncodingException uee) {
-	            throw new SlingUnsupportedEncodingException(uee);
-	        }
-	        this.encoding = encoding;
-	    }
-
-	    /**
-	     * @see org.apache.sling.api.request.RequestParameter#get()
-	     */
-	    public byte[] get() {
-	        if (content == null) {
-	            try {
-	                content = getString().getBytes(getEncoding());
-	            } catch (Exception e) {
-	                // UnsupportedEncodingException, IllegalArgumentException
-	                content = getString().getBytes();
-	            }
-	        }
-	        return content;
-	    }
-
-	    /**
-	     * @see org.apache.sling.api.request.RequestParameter#getContentType()
-	     */
-	    public String getContentType() {
-	        // none known for www-form-encoded parameters
-	        return null;
-	    }
-
-	    /**
-	     * @see org.apache.sling.api.request.RequestParameter#getInputStream()
-	     */
-	    public InputStream getInputStream() {
-	        return new ByteArrayInputStream(this.get());
-	    }
-
-	    /**
-	     * @see org.apache.sling.api.request.RequestParameter#getFileName()
-	     */
-	    public String getFileName() {
-	        // no original file name
-	        return null;
-	    }
-
-	    /**
-	     * @see org.apache.sling.api.request.RequestParameter#getSize()
-	     */
-	    public long getSize() {
-	        return this.get().length;
-	    }
-
-	    /**
-	     * @see org.apache.sling.api.request.RequestParameter#getString()
-	     */
-	    public String getString() {
-	        return value;
-	    }
-
-	    /**
-	     * @see org.apache.sling.api.request.RequestParameter#getString(java.lang.String)
-	     */
-	    public String getString(String encoding)
-	            throws UnsupportedEncodingException {
-	        return new String(this.get(), encoding);
-	    }
-
-	    /**
-	     * @see org.apache.sling.api.request.RequestParameter#isFormField()
-	     */
-	    public boolean isFormField() {
-	        // www-form-encoded are always form fields
-	        return true;
-	    }
-
-	    public String toString() {
-	        return this.getString();
-	    }
-	}
-	
-	static class SlingUnsupportedEncodingException extends SlingIOException {
-
-	    private static final long serialVersionUID = -4482276105859280247L;
-
-	    SlingUnsupportedEncodingException(UnsupportedEncodingException uee) {
-	        super(uee);
-	    }
-
-	}
+    static class SlingUnsupportedEncodingException extends SlingIOException {
+
+        private static final long serialVersionUID = -4482276105859280247L;
+
+        SlingUnsupportedEncodingException(UnsupportedEncodingException uee) {
+            super(uee);
+        }
+
+    }
     
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractGroupPostServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractGroupPostServlet.java
index 5d10d6c..8da122c 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractGroupPostServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractGroupPostServlet.java
@@ -49,9 +49,9 @@ public abstract class AbstractGroupPostServlet extends
      * @throws RepositoryException
      */
     protected void updateGroupMembership(Resource baseResource,
-    									Map<String, ?> properties,
-							            Authorizable authorizable, 
-							            List<Modification> changes)
+                                        Map<String, ?> properties,
+                                        Authorizable authorizable, 
+                                        List<Modification> changes)
             throws RepositoryException {
         if (authorizable.isGroup()) {
             Group group = ((Group) authorizable);
@@ -106,23 +106,23 @@ public abstract class AbstractGroupPostServlet extends
      * @param resolver the resource resolver for this request.
      * @return the authorizable, or null if no authorizable was found.
      */
-	private Authorizable getAuthorizable(Resource baseResource, 
-						    		String member, 
-						    		UserManager userManager,
-						    		ResourceResolver resolver) {
-		Authorizable memberAuthorizable = null;
-		try {
-			memberAuthorizable = userManager.getAuthorizable(member);
-		} catch (RepositoryException e) {
-			// if we can't find the members then it may be resolvable as a resource.
-		}
-		if ( memberAuthorizable == null ) {
-			Resource res = resolver.getResource(baseResource, member);
-			if (res != null) {
-				memberAuthorizable = res.adaptTo(Authorizable.class);
-			}
-		}
-		return memberAuthorizable;
-	}
+    private Authorizable getAuthorizable(Resource baseResource, 
+                                    String member, 
+                                    UserManager userManager,
+                                    ResourceResolver resolver) {
+        Authorizable memberAuthorizable = null;
+        try {
+            memberAuthorizable = userManager.getAuthorizable(member);
+        } catch (RepositoryException e) {
+            // if we can't find the members then it may be resolvable as a resource.
+        }
+        if ( memberAuthorizable == null ) {
+            Resource res = resolver.getResource(baseResource, member);
+            if (res != null) {
+                memberAuthorizable = res.adaptTo(Authorizable.class);
+            }
+        }
+        return memberAuthorizable;
+    }
 
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractPostServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractPostServlet.java
index e6e0311..fec6cae 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractPostServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractPostServlet.java
@@ -45,9 +45,9 @@ import org.slf4j.LoggerFactory;
 public abstract class AbstractPostServlet extends
         SlingAllMethodsServlet {
 
-	private static final long serialVersionUID = 7408267654653472120L;
-	
-	/**
+    private static final long serialVersionUID = 7408267654653472120L;
+    
+    /**
      * default log
      */
     private final Logger log = LoggerFactory.getLogger(getClass());
@@ -161,11 +161,11 @@ public abstract class AbstractPostServlet extends
      * or a {@link org.apache.sling.api.servlets.HtmlResponse} otherwise
      */
     protected HtmlResponse createHtmlResponse(SlingHttpServletRequest req) {
-    	if (JSONResponse.RESPONSE_CONTENT_TYPE.equals(req.getResponseContentType())) {
-    		return new JSONResponse();
-    	} else {
+        if (JSONResponse.RESPONSE_CONTENT_TYPE.equals(req.getResponseContentType())) {
+            return new JSONResponse();
+        } else {
             return new HtmlResponse();
-    	}
+        }
     }
     
     /**
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
index b5d5dd5..1f6fdfd 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
@@ -126,7 +126,7 @@ public class ChangeUserPasswordServlet extends AbstractUserPostServlet implement
         Dictionary<?, ?> props = componentContext.getProperties();
         
         this.userAdminGroupName = OsgiUtil.toString(props.get(PAR_USER_ADMIN_GROUP_NAME),
-        		DEFAULT_USER_ADMIN_GROUP_NAME);
+                DEFAULT_USER_ADMIN_GROUP_NAME);
         log.info("User Admin Group Name {}", this.userAdminGroupName);
     }
     
@@ -141,45 +141,45 @@ public class ChangeUserPasswordServlet extends AbstractUserPostServlet implement
     protected void handleOperation(SlingHttpServletRequest request,
             HtmlResponse htmlResponse, List<Modification> changes)
             throws RepositoryException {
-    	
+        
         Resource resource = request.getResource();
         Session session = request.getResourceResolver().adaptTo(Session.class);
-    	changePassword(session, 
-    			resource.getName(), 
-    			request.getParameter("oldPwd"), 
-    			request.getParameter("newPwd"), 
-    			request.getParameter("newPwdConfirm"), 
-				changes);
+        changePassword(session, 
+                resource.getName(), 
+                request.getParameter("oldPwd"), 
+                request.getParameter("newPwd"), 
+                request.getParameter("newPwdConfirm"), 
+                changes);
     }
     
-	/* (non-Javadoc)
-	 * @see org.apache.sling.jackrabbit.usermanager.ChangeUserPassword#changePassword(javax.jcr.Session, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.List)
-	 */
-	public User changePassword(Session jcrSession, 
-								String name,
-								String oldPassword, 
-								String newPassword, 
-								String newPasswordConfirm,
-								List<Modification> changes) 
-				throws RepositoryException {
-		
+    /* (non-Javadoc)
+     * @see org.apache.sling.jackrabbit.usermanager.ChangeUserPassword#changePassword(javax.jcr.Session, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.List)
+     */
+    public User changePassword(Session jcrSession, 
+                                String name,
+                                String oldPassword, 
+                                String newPassword, 
+                                String newPasswordConfirm,
+                                List<Modification> changes) 
+                throws RepositoryException {
+        
         if ("anonymous".equals(name)) {
             throw new RepositoryException(
                 "Can not change the password of the anonymous user.");
         }
-		
-		User user;
+        
+        User user;
         UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
         Authorizable authorizable = userManager.getAuthorizable(name);
         if (authorizable instanceof User) {
-        	user = (User)authorizable;
+            user = (User)authorizable;
         } else {
             throw new ResourceNotFoundException(
-            	"User to update could not be determined");
+                "User to update could not be determined");
         }
         
-    	//SLING-2069: if the current user is an administrator, then a missing oldPwd is ok,
-    	// otherwise the oldPwd must be supplied.
+        //SLING-2069: if the current user is an administrator, then a missing oldPwd is ok,
+        // otherwise the oldPwd must be supplied.
         boolean administrator = false;
 
         // check that the submitted parameter values have valid values.
@@ -190,22 +190,22 @@ public class ChangeUserPasswordServlet extends AbstractUserPostServlet implement
                 administrator = currentUser.isAdmin();
                 
                 if (!administrator) {
-    				//check if the user is a member of the 'User administrator' group
-    				Authorizable userAdmin = um.getAuthorizable(this.userAdminGroupName);
-    				if (userAdmin instanceof Group) {
-    					boolean isMember = ((Group)userAdmin).isMember(currentUser);
-    					if (isMember) {
-    						administrator = true;
-    					}
-    				}
-                	
+                    //check if the user is a member of the 'User administrator' group
+                    Authorizable userAdmin = um.getAuthorizable(this.userAdminGroupName);
+                    if (userAdmin instanceof Group) {
+                        boolean isMember = ((Group)userAdmin).isMember(currentUser);
+                        if (isMember) {
+                            administrator = true;
+                        }
+                    }
+                    
                 }
             } catch ( Exception ex ) {
                 log.warn("Failed to determine if the user is an admin, assuming not. Cause: "+ex.getMessage());
                 administrator = false;
             }
             if (!administrator) {
-            	throw new RepositoryException("Old Password was not submitted");
+                throw new RepositoryException("Old Password was not submitted");
             }
         }
         if (newPassword == null || newPassword.length() == 0) {
@@ -225,7 +225,7 @@ public class ChangeUserPasswordServlet extends AbstractUserPostServlet implement
             ((User) authorizable).changePassword(digestPassword(newPassword));
 
             String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
-            	+ user.getID();
+                + user.getID();
 
             changes.add(Modification.onModified(userPath
                 + "/rep:password"));
@@ -234,7 +234,7 @@ public class ChangeUserPasswordServlet extends AbstractUserPostServlet implement
         }
         
         return user;
-	}
+    }
     
 
     private void checkPassword(Authorizable authorizable, String oldPassword)
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
index 88721e1..a2e5c47 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
@@ -88,7 +88,7 @@ public class CreateGroupServlet extends AbstractGroupPostServlet implements Crea
     private static final long serialVersionUID = -1084915263933901466L;
 
     /** @scr.reference */
-	private JcrResourceResolverFactory resourceResolverFactory;
+    private JcrResourceResolverFactory resourceResolverFactory;
     
     /*
      * (non-Javadoc)
@@ -105,28 +105,28 @@ public class CreateGroupServlet extends AbstractGroupPostServlet implements Crea
         Session session = request.getResourceResolver().adaptTo(Session.class);
         String principalName = request.getParameter(SlingPostConstants.RP_NODE_NAME);
         Group group = createGroup(session, 
-        		principalName, 
-        		request.getRequestParameterMap(), 
-        		changes);
+                principalName, 
+                request.getRequestParameterMap(), 
+                changes);
 
         String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
-        	+ group.getID();
+            + group.getID();
         response.setPath(groupPath);
         response.setLocation(externalizePath(request, groupPath));
         response.setParentLocation(externalizePath(request,
             AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PATH));
         
     }
-	
-	/* (non-Javadoc)
-	 * @see org.apache.sling.jackrabbit.usermanager.CreateGroup#createGroup(javax.jcr.Session, java.lang.String, java.util.Map, java.util.List)
-	 */
-	public Group createGroup(Session jcrSession, final String name,
-			Map<String, ?> properties, List<Modification> changes)
-			throws RepositoryException {
+    
+    /* (non-Javadoc)
+     * @see org.apache.sling.jackrabbit.usermanager.CreateGroup#createGroup(javax.jcr.Session, java.lang.String, java.util.Map, java.util.List)
+     */
+    public Group createGroup(Session jcrSession, final String name,
+            Map<String, ?> properties, List<Modification> changes)
+            throws RepositoryException {
         // check that the parameter values have valid values.
-		if (jcrSession == null) {
-			throw new IllegalArgumentException("JCR Session not found");
+        if (jcrSession == null) {
+            throw new IllegalArgumentException("JCR Session not found");
         }
 
         if (name == null || name.length() == 0) {
@@ -162,18 +162,18 @@ public class CreateGroupServlet extends AbstractGroupPostServlet implements Crea
             // update the group memberships
             ResourceResolver resourceResolver = null;
             try {
-            	//create a resource resolver to resolve the relative paths used for group membership values
+                //create a resource resolver to resolve the relative paths used for group membership values
                 resourceResolver = resourceResolverFactory.getResourceResolver(jcrSession);
                 Resource baseResource = resourceResolver.getResource(AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PATH);
                 updateGroupMembership(baseResource, properties, group, changes);
             } finally {
-            	if (resourceResolver != null) {
-            		resourceResolver.close();
-            	}
+                if (resourceResolver != null) {
+                    resourceResolver.close();
+                }
             }
         }
         
         return group;
-	}
+    }
     
 }
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 ec95910..23c622e 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
@@ -170,7 +170,7 @@ public class CreateUserServlet extends AbstractUserPostServlet implements Create
         Dictionary<?, ?> props = componentContext.getProperties();
         Object propValue = props.get(PROP_SELF_REGISTRATION_ENABLED);
         if (propValue instanceof Boolean) {
-        	selfRegistrationEnabled = (Boolean)propValue;
+            selfRegistrationEnabled = (Boolean)propValue;
         } else if (propValue instanceof String) {
             selfRegistrationEnabled = Boolean.parseBoolean((String) propValue);
         } else {
@@ -178,7 +178,7 @@ public class CreateUserServlet extends AbstractUserPostServlet implements Create
         }
         
         this.userAdminGroupName = OsgiUtil.toString(props.get(PAR_USER_ADMIN_GROUP_NAME),
-        		DEFAULT_USER_ADMIN_GROUP_NAME);
+                DEFAULT_USER_ADMIN_GROUP_NAME);
         log.info("User Admin Group Name {}", this.userAdminGroupName);
     }
 
@@ -197,32 +197,32 @@ public class CreateUserServlet extends AbstractUserPostServlet implements Create
 
         Session session = request.getResourceResolver().adaptTo(Session.class);
         String principalName = request.getParameter(SlingPostConstants.RP_NODE_NAME);
-    	User user = createUser(session, 
-    						principalName, 
-    						request.getParameter("pwd"),
-    						request.getParameter("pwdConfirm"),
-    						request.getRequestParameterMap(), 
-    						changes);
-    	
+        User user = createUser(session, 
+                            principalName, 
+                            request.getParameter("pwd"),
+                            request.getParameter("pwdConfirm"),
+                            request.getRequestParameterMap(), 
+                            changes);
+        
         String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX
-    			+ user.getID();
+                + user.getID();
         response.setPath(userPath);
         response.setLocation(externalizePath(request, userPath));
         response.setParentLocation(externalizePath(request,
             AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PATH));
     }
     
-	/* (non-Javadoc)
-	 * @see org.apache.sling.jackrabbit.usermanager.CreateUser#createUser(javax.jcr.Session, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.util.List)
-	 */
-	public User createUser(Session jcrSession, 
-							String name, 
-							String password,
-							String passwordConfirm, 
-							Map<String, ?> properties,
-							List<Modification> changes) 
-			throws RepositoryException {
-		
+    /* (non-Javadoc)
+     * @see org.apache.sling.jackrabbit.usermanager.CreateUser#createUser(javax.jcr.Session, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.util.List)
+     */
+    public User createUser(Session jcrSession, 
+                            String name, 
+                            String password,
+                            String passwordConfirm, 
+                            Map<String, ?> properties,
+                            List<Modification> changes) 
+            throws RepositoryException {
+        
         if (jcrSession == null) {
             throw new RepositoryException("JCR Session not found");
         }
@@ -235,15 +235,15 @@ public class CreateUserServlet extends AbstractUserPostServlet implements Create
             administrator = currentUser.isAdmin();
             
             if (!administrator) {
-				//check if the user is a member of the 'User administrator' group
-				Authorizable userAdmin = um.getAuthorizable(this.userAdminGroupName);
-				if (userAdmin instanceof Group) {
-					boolean isMember = ((Group)userAdmin).isMember(currentUser);
-					if (isMember) {
-						administrator = true;
-					}
-				}
-            	
+                //check if the user is a member of the 'User administrator' group
+                Authorizable userAdmin = um.getAuthorizable(this.userAdminGroupName);
+                if (userAdmin instanceof Group) {
+                    boolean isMember = ((Group)userAdmin).isMember(currentUser);
+                    if (isMember) {
+                        administrator = true;
+                    }
+                }
+                
             }
         } catch ( Exception ex ) {
             log.warn("Failed to determine if the user is an admin, assuming not. Cause: "+ex.getMessage());
@@ -275,11 +275,11 @@ public class CreateUserServlet extends AbstractUserPostServlet implements Create
         boolean useAdminSession = !administrator && selfRegistrationEnabled;
         try {
             if (useAdminSession) {
-            	//the current user doesn't have permission to create the user,
-            	// but self-registration is enabled, so use an admin session
-            	// to do the work.
+                //the current user doesn't have permission to create the user,
+                // but self-registration is enabled, so use an admin session
+                // to do the work.
                 selfRegSession = getSession();
-            }        	
+            }           
 
             UserManager userManager = AccessControlUtil.getUserManager(selfRegSession);
             Authorizable authorizable = userManager.getAuthorizable(name);
@@ -307,24 +307,24 @@ public class CreateUserServlet extends AbstractUserPostServlet implements Create
                 }
                 
                 if (useAdminSession) {
-                	//lookup the user from the user session so we can return a live object
+                    //lookup the user from the user session so we can return a live object
                     UserManager userManager2 = AccessControlUtil.getUserManager(jcrSession);
                     Authorizable authorizable2 = userManager2.getAuthorizable(user.getID());
                     if (authorizable2 instanceof User) {
-                    	user = (User)authorizable2;
+                        user = (User)authorizable2;
                     } else {
-                    	user = null;
+                        user = null;
                     }
                 }                
             }
         } finally {
             if (useAdminSession) {
-            	//done with the self-reg admin session, so clean it up
+                //done with the self-reg admin session, so clean it up
                 ungetSession(selfRegSession);
-            }        	
+            }           
         }
-		
-		return user;
-	}
+        
+        return user;
+    }
     
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java
index 088197a..171bf4e 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java
@@ -88,7 +88,7 @@ import org.apache.sling.servlets.post.SlingPostConstants;
  * @scr.property name="sling.servlet.selectors" value="delete"
  */
 public class DeleteAuthorizableServlet extends AbstractPostServlet
-		implements DeleteUser, DeleteGroup, DeleteAuthorizables {
+        implements DeleteUser, DeleteGroup, DeleteAuthorizables {
     private static final long serialVersionUID = 5874621724096106496L;
 
     /*
@@ -107,10 +107,10 @@ public class DeleteAuthorizableServlet extends AbstractPostServlet
         Resource resource = request.getResource();
         String[] applyTo = request.getParameterValues(SlingPostConstants.RP_APPLY_TO);
         if (applyTo != null) {
-        	deleteAuthorizables(session,
-        			resource,
-        			applyTo, 
-        			changes);
+            deleteAuthorizables(session,
+                    resource,
+                    applyTo, 
+                    changes);
         } else {
             Authorizable item = resource.adaptTo(Authorizable.class);
             if (item == null) {
@@ -119,70 +119,70 @@ public class DeleteAuthorizableServlet extends AbstractPostServlet
                 htmlResponse.setStatus(HttpServletResponse.SC_NOT_FOUND, msg);
                 throw new ResourceNotFoundException(msg);
             } else {
-            	if (item instanceof User) {
-            		deleteUser(session, item.getID(), changes);
-            	} else if (item instanceof Group) {
-            		deleteGroup(session, item.getID(), changes);
-            	}
+                if (item instanceof User) {
+                    deleteUser(session, item.getID(), changes);
+                } else if (item instanceof Group) {
+                    deleteGroup(session, item.getID(), changes);
+                }
             }
         }
     }
     
-	/* (non-Javadoc)
-	 * @see org.apache.sling.jackrabbit.usermanager.DeleteUser#deleteUser(javax.jcr.Session, java.lang.String, java.util.List)
-	 */
-	public void deleteUser(Session jcrSession, String name,
-			List<Modification> changes) throws RepositoryException {
-
-		User user;
-		UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
+    /* (non-Javadoc)
+     * @see org.apache.sling.jackrabbit.usermanager.DeleteUser#deleteUser(javax.jcr.Session, java.lang.String, java.util.List)
+     */
+    public void deleteUser(Session jcrSession, String name,
+            List<Modification> changes) throws RepositoryException {
+
+        User user;
+        UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
         Authorizable authorizable = userManager.getAuthorizable(name);
         if (authorizable instanceof User) {
-        	user = (User)authorizable;
+            user = (User)authorizable;
         } else {
             throw new ResourceNotFoundException(
-        		"User to delete could not be determined");
+                "User to delete could not be determined");
         }
         
         String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX
-							+ user.getID();
+                            + user.getID();
         user.remove();
         changes.add(Modification.onDeleted(userPath));
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.apache.sling.jackrabbit.usermanager.DeleteGroup#deleteGroup(javax.jcr.Session, java.lang.String, java.util.List)
-	 */
-	public void deleteGroup(Session jcrSession, 
-							String name,
-							List<Modification> changes) throws RepositoryException {
-
-		Group group;
-		UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.sling.jackrabbit.usermanager.DeleteGroup#deleteGroup(javax.jcr.Session, java.lang.String, java.util.List)
+     */
+    public void deleteGroup(Session jcrSession, 
+                            String name,
+                            List<Modification> changes) throws RepositoryException {
+
+        Group group;
+        UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
         Authorizable authorizable = userManager.getAuthorizable(name);
         if (authorizable instanceof Group) {
-        	group = (Group)authorizable;
+            group = (Group)authorizable;
         } else {
             throw new ResourceNotFoundException(
-        		"Group to delete could not be determined");
+                "Group to delete could not be determined");
         }
         
         String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
-								+ group.getID();
+                                + group.getID();
         group.remove();
         changes.add(Modification.onDeleted(groupPath));
-	}
-
-	/* (non-Javadoc)
-	 * @see org.apache.sling.jackrabbit.usermanager.DeleteAuthorizables#deleteAuthorizables(javax.jcr.Session, org.apache.sling.api.resource.Resource, java.lang.String[], java.util.List)
-	 */
-	public void deleteAuthorizables(Session jcrSession, 
-									Resource baseResource,
-									String[] paths, 
-									List<Modification> changes)
-			throws RepositoryException {
-
-		ApplyToIterator iterator = new ApplyToIterator(baseResource, paths);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.sling.jackrabbit.usermanager.DeleteAuthorizables#deleteAuthorizables(javax.jcr.Session, org.apache.sling.api.resource.Resource, java.lang.String[], java.util.List)
+     */
+    public void deleteAuthorizables(Session jcrSession, 
+                                    Resource baseResource,
+                                    String[] paths, 
+                                    List<Modification> changes)
+            throws RepositoryException {
+
+        ApplyToIterator iterator = new ApplyToIterator(baseResource, paths);
         while (iterator.hasNext()) {
             Resource resource = iterator.next();
             Authorizable item = resource.adaptTo(Authorizable.class);
@@ -191,7 +191,7 @@ public class DeleteAuthorizableServlet extends AbstractPostServlet
                 changes.add(Modification.onDeleted(resource.getPath()));
             }
         }
-	}
+    }
 
     private static class ApplyToIterator implements Iterator<Resource> {
 
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java
index 6f36439..eefa36c 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java
@@ -85,11 +85,11 @@ import org.apache.sling.servlets.post.impl.helper.RequestProperty;
  * @scr.property name="sling.servlet.selectors" value="update"
  */
 public class UpdateGroupServlet extends AbstractGroupPostServlet 
-		implements UpdateGroup {
+        implements UpdateGroup {
     private static final long serialVersionUID = -8292054361992488797L;
 
     /** @scr.reference */
-	private JcrResourceResolverFactory resourceResolverFactory;
+    private JcrResourceResolverFactory resourceResolverFactory;
     
     /*
      * (non-Javadoc)
@@ -105,30 +105,30 @@ public class UpdateGroupServlet extends AbstractGroupPostServlet
         Resource resource = request.getResource();
         Session session = request.getResourceResolver().adaptTo(Session.class);
         updateGroup(session,
-        				resource.getName(),
-        				request.getRequestParameterMap(), 
-        				changes);
+                        resource.getName(),
+                        request.getRequestParameterMap(), 
+                        changes);
     }
     
-	/* (non-Javadoc)
-	 * @see org.apache.sling.jackrabbit.usermanager.UpdateGroup#updateGroup(javax.jcr.Session, java.lang.String, java.util.Map, java.util.List)
-	 */
-	public Group updateGroup(Session jcrSession, 
-								String name,
-								Map<String, ?> properties, 
-								List<Modification> changes)
-			throws RepositoryException {
+    /* (non-Javadoc)
+     * @see org.apache.sling.jackrabbit.usermanager.UpdateGroup#updateGroup(javax.jcr.Session, java.lang.String, java.util.Map, java.util.List)
+     */
+    public Group updateGroup(Session jcrSession, 
+                                String name,
+                                Map<String, ?> properties, 
+                                List<Modification> changes)
+            throws RepositoryException {
 
-		Group group = null;
+        Group group = null;
         UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
         Authorizable authorizable = userManager.getAuthorizable(name);
         if (authorizable instanceof Group) {
-        	group = (Group)authorizable;
+            group = (Group)authorizable;
         } else {
             throw new ResourceNotFoundException(
-            	"Group to update could not be determined");
+                "Group to update could not be determined");
         }
-		
+        
         String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
             + group.getID();
 
@@ -143,19 +143,19 @@ public class UpdateGroupServlet extends AbstractGroupPostServlet
             // update the group memberships
             ResourceResolver resourceResolver = null;
             try {
-            	//create a resource resolver to resolve the relative paths used for group membership values
+                //create a resource resolver to resolve the relative paths used for group membership values
                 resourceResolver = resourceResolverFactory.getResourceResolver(jcrSession);
                 Resource baseResource = resourceResolver.getResource(groupPath);
                 updateGroupMembership(baseResource, properties, group, changes);
             } finally {
-            	if (resourceResolver != null) {
-            		resourceResolver.close();
-            	}
+                if (resourceResolver != null) {
+                    resourceResolver.close();
+                }
             }
         } catch (RepositoryException re) {
             throw new RepositoryException("Failed to update group.", re);
         }
         return group;
-	}
+    }
     
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
index 2142a4f..cd9ac31 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
@@ -84,7 +84,7 @@ import org.apache.sling.servlets.post.impl.helper.RequestProperty;
  * @scr.property name="sling.servlet.selectors" value="update"
  */
 public class UpdateUserServlet extends AbstractUserPostServlet 
-		implements UpdateUser {
+        implements UpdateUser {
     private static final long serialVersionUID = 5874621724096106496L;
 
     /*
@@ -101,26 +101,26 @@ public class UpdateUserServlet extends AbstractUserPostServlet
         Resource resource = request.getResource();
         Session session = request.getResourceResolver().adaptTo(Session.class);
         updateUser(session,
-        		resource.getName(),
-				request.getRequestParameterMap(), 
-				changes);
+                resource.getName(),
+                request.getRequestParameterMap(), 
+                changes);
     }
     
-	/* (non-Javadoc)
-	 * @see org.apache.sling.jackrabbit.usermanager.UpdateUser#updateUser(javax.jcr.Session, java.lang.String, java.util.Map, java.util.List)
-	 */
-	public User updateUser(Session jcrSession, String name,
-			Map<String, ?> properties, List<Modification> changes)
-			throws RepositoryException {
+    /* (non-Javadoc)
+     * @see org.apache.sling.jackrabbit.usermanager.UpdateUser#updateUser(javax.jcr.Session, java.lang.String, java.util.Map, java.util.List)
+     */
+    public User updateUser(Session jcrSession, String name,
+            Map<String, ?> properties, List<Modification> changes)
+            throws RepositoryException {
         
-		User user;
+        User user;
         UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
         Authorizable authorizable = userManager.getAuthorizable(name);
         if (authorizable instanceof User) {
-        	user = (User)authorizable;
+            user = (User)authorizable;
         } else {
             throw new ResourceNotFoundException(
-            	"User to update could not be determined");
+                "User to update could not be determined");
         }
         
         String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
@@ -138,19 +138,19 @@ public class UpdateUserServlet extends AbstractUserPostServlet
             // has supplied the relevant properties
             String disabledParam = convertToString(properties.get(":disabled"));
             if ("true".equalsIgnoreCase(disabledParam)) {
-            	//set the user as disabled
-            	String disabledReason = convertToString(properties.get(":disabledReason"));
-            	if (disabledReason == null) {
-            		disabledReason = "";
-            	}
-            	user.disable(disabledReason);
+                //set the user as disabled
+                String disabledReason = convertToString(properties.get(":disabledReason"));
+                if (disabledReason == null) {
+                    disabledReason = "";
+                }
+                user.disable(disabledReason);
             } else if ("false".equalsIgnoreCase(disabledParam)) {
-            	//re-enable a disabled user
-            	user.disable(null);
+                //re-enable a disabled user
+                user.disable(null);
             }
         } catch (RepositoryException re) {
             throw new RepositoryException("Failed to update user.", re);
         }
         return user;
-	}    
+    }    
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 07/24: SLING-2067 Added null check to AuthorizablePrivilegesInfo to fix NPE when used in a script that is being rendered for the anonymous user

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 66850fe9dc70c8919c7db63a0242ec3ed37b9156
Author: Eric Norman <en...@apache.org>
AuthorDate: Sun May 1 23:13:21 2011 +0000

    SLING-2067 Added null check to AuthorizablePrivilegesInfo to fix NPE when used in a script that is being rendered for the anonymous user
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1098439 13f79535-47bb-0310-9956-ffa450edef68
---
 .../impl/AuthorizablePrivilegesInfoImpl.java       | 76 ++++++++++++++++------
 1 file changed, 55 insertions(+), 21 deletions(-)

diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
index f158c9a..f3fc51a 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
@@ -23,6 +23,7 @@ import java.util.Dictionary;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.servlet.Servlet;
 
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
@@ -31,6 +32,9 @@ import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.sling.commons.osgi.OsgiUtil;
 import org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo;
 import org.apache.sling.jcr.base.util.AccessControlUtil;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
 import org.osgi.service.component.ComponentContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -110,16 +114,18 @@ public class AuthorizablePrivilegesInfoImpl implements AuthorizablePrivilegesInf
 			UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
 			Authorizable currentUser = userManager.getAuthorizable(jcrSession.getUserID());
 
-			if (((User)currentUser).isAdmin()) {
-				return true; //admin user has full control
-			}
-			
-			//check if the user is a member of the 'Group administrator' group
-			Authorizable groupAdmin = userManager.getAuthorizable(this.groupAdminGroupName);
-			if (groupAdmin instanceof Group) {
-				boolean isMember = ((Group)groupAdmin).isMember(currentUser);
-				if (isMember) {
-					return true;
+			if (currentUser != null) {
+				if (((User)currentUser).isAdmin()) {
+					return true; //admin user has full control
+				}
+				
+				//check if the user is a member of the 'Group administrator' group
+				Authorizable groupAdmin = userManager.getAuthorizable(this.groupAdminGroupName);
+				if (groupAdmin instanceof Group) {
+					boolean isMember = ((Group)groupAdmin).isMember(currentUser);
+					if (isMember) {
+						return true;
+					}
 				}
 			}
 		} catch (RepositoryException e) {
@@ -133,23 +139,46 @@ public class AuthorizablePrivilegesInfoImpl implements AuthorizablePrivilegesInf
 	 */
 	public boolean canAddUser(Session jcrSession) {
 		try {
+			//if self-registration is enabled, then anyone can create a user
+			if (componentContext != null) {
+				String filter = "(&(sling.servlet.resourceTypes=sling/users)(|(sling.servlet.methods=POST)(sling.servlet.selectors=create)))";
+				BundleContext bundleContext = componentContext.getBundleContext();
+				ServiceReference[] serviceReferences = bundleContext.getServiceReferences(Servlet.class.getName(), filter);
+				if (serviceReferences != null) {
+					String propName = "self.registration.enabled";
+					for (ServiceReference serviceReference : serviceReferences) {
+						Object propValue = serviceReference.getProperty(propName);
+						if (propValue != null) {
+							boolean selfRegEnabled = Boolean.TRUE.equals(propValue);
+							if (selfRegEnabled) {
+								return true;
+							}
+							break;
+						}
+					}
+				}
+			}
+
 			UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
 			Authorizable currentUser = userManager.getAuthorizable(jcrSession.getUserID());
-
-			if (((User)currentUser).isAdmin()) {
-				return true; //admin user has full control
-			}
-			
-			//check if the user is a member of the 'User administrator' group
-			Authorizable userAdmin = userManager.getAuthorizable(this.userAdminGroupName);
-			if (userAdmin instanceof Group) {
-				boolean isMember = ((Group)userAdmin).isMember(currentUser);
-				if (isMember) {
-					return true;
+			if (currentUser != null) {
+				if (((User)currentUser).isAdmin()) {
+					return true; //admin user has full control
+				}
+				
+				//check if the user is a member of the 'User administrator' group
+				Authorizable userAdmin = userManager.getAuthorizable(this.userAdminGroupName);
+				if (userAdmin instanceof Group) {
+					boolean isMember = ((Group)userAdmin).isMember(currentUser);
+					if (isMember) {
+						return true;
+					}
 				}
 			}
 		} catch (RepositoryException e) {
 			log.warn("Failed to determine if {} can add a new user", jcrSession.getUserID());
+		} catch (InvalidSyntaxException e) {
+			log.warn("Failed to determine if {} can add a new user", jcrSession.getUserID());
 		}
 		return false;
 	}
@@ -276,6 +305,9 @@ public class AuthorizablePrivilegesInfoImpl implements AuthorizablePrivilegesInf
 
 	// ---------- SCR Integration ----------------------------------------------
 
+	//keep track of the bundle context
+	private ComponentContext componentContext;
+
     /**
      * Called by SCR to activate the component.
      *
@@ -288,6 +320,8 @@ public class AuthorizablePrivilegesInfoImpl implements AuthorizablePrivilegesInf
             throws InvalidKeyException, NoSuchAlgorithmException,
             IllegalStateException, UnsupportedEncodingException {
 
+    	this.componentContext = componentContext;
+    	
         Dictionary<?, ?> properties = componentContext.getProperties();
 
         this.userAdminGroupName = OsgiUtil.toString(properties.get(PAR_USER_ADMIN_GROUP_NAME),

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 03/24: Update to recent snapshots

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 310e566c8ff9efd534a463a2e504bcfde6218e6b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Dec 8 16:37:27 2010 +0000

    Update to recent snapshots
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1043504 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index bac2abf..2608353 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>10-SNAPSHOT</version>
+        <version>11-SNAPSHOT</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 02/24: using latest parent

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit dfa77d878bd60d7c078ceb61d47e9b6e6722df10
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Nov 10 14:36:33 2010 +0000

    using latest parent
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1033492 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 7983e73..bac2abf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>9</version>
+        <version>10-SNAPSHOT</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 21/24: tabs -> spaces

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 11466dd2492fc7dfdbae30e18cdc436841ef8e25
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Nov 10 21:25:36 2011 +0000

    tabs -> spaces
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1200564 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index c1896c1..18c0134 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,7 +34,7 @@
     <description>
         Provides ResourceProvider and SlingPostOperations for the Jackrabbit
         UserManager.
-	</description>
+    </description>
 
     <scm>
         <connection>
@@ -60,9 +60,9 @@
                 <extensions>true</extensions>
                 <configuration>
                     <instructions>
-						<Export-Package>
+                        <Export-Package>
                             org.apache.sling.jackrabbit.usermanager;version=2.1.0,
-						</Export-Package>
+                        </Export-Package>
                         <Private-Package>
                             org.apache.sling.jackrabbit.usermanager.impl.*
                         </Private-Package>
@@ -121,7 +121,7 @@
             <version>2.0.6</version>
             <scope>provided</scope>
         </dependency>
-		<dependency>
+        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 16/24: Using latest released parent pom

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 98ca2bb927e6adbf0f2a8b2226155fe1680bb7b4
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Aug 8 11:31:38 2011 +0000

    Using latest released parent pom
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1154924 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 2607d12..9c92c21 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>12-SNAPSHOT</version>
+        <version>11</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 01/24: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit c11dee66a8515cf98866262d24bbbd325293fdf7
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Nov 3 17:57:00 2010 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1030574 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index e99dfe8..7983e73 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.jcr.jackrabbit.usermanager</artifactId>
     <packaging>bundle</packaging>
-    <version>2.1.0</version>
+    <version>2.1.1-SNAPSHOT</version>
     <name>Apache Sling Jackrabbit UserManager Support</name>
     <description>
         Provides ResourceProvider and SlingPostOperations for the Jackrabbit
@@ -38,13 +38,13 @@
 
     <scm>
         <connection>
-            scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.jackrabbit.usermanager-2.1.0
+            scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager
         </connection>
         <developerConnection>
-            scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.jackrabbit.usermanager-2.1.0
+            scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager
         </developerConnection>
         <url>
-            http://svn.apache.org/viewvc/sling/tags/org.apache.sling.jcr.jackrabbit.usermanager-2.1.0
+            http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-usermanager
         </url>
     </scm>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 19/24: using latest releases

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit a9987114904b95ec19f5a11f35c26084e85275b3
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Sep 7 14:35:51 2011 +0000

    using latest releases
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1166199 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 14ea6f1..c1896c1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>13-SNAPSHOT</version>
+        <version>12</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-jackrabbit-usermanager] 12/24: SLING-1555 UserManager permissions manipulation services that mirror the functionality of the REST operations for programmatic user management code.

Posted by ro...@apache.org.
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.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 82447c70c988d2b84997a97eba9ca69783707594
Author: Eric Norman <en...@apache.org>
AuthorDate: Thu May 19 05:17:48 2011 +0000

    SLING-1555 UserManager permissions manipulation services that mirror the functionality of the REST operations for programmatic user management code.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1124537 13f79535-47bb-0310-9956-ffa450edef68
---
 .../jackrabbit/usermanager/ChangeUserPassword.java |  58 ++++++
 .../sling/jackrabbit/usermanager/CreateGroup.java  |  55 ++++++
 .../sling/jackrabbit/usermanager/CreateUser.java   |  59 ++++++
 .../usermanager/DeleteAuthorizables.java           |  53 +++++
 .../sling/jackrabbit/usermanager/DeleteGroup.java  |  50 +++++
 .../sling/jackrabbit/usermanager/DeleteUser.java   |  50 +++++
 .../sling/jackrabbit/usermanager/UpdateGroup.java  |  55 ++++++
 .../sling/jackrabbit/usermanager/UpdateUser.java   |  55 ++++++
 .../impl/post/AbstractAuthorizablePostServlet.java | 220 +++++++++++++++++++--
 .../impl/post/AbstractGroupPostServlet.java        |  53 ++---
 .../impl/post/ChangeUserPasswordServlet.java       |  84 +++++---
 .../usermanager/impl/post/CreateGroupServlet.java  |  82 +++++---
 .../usermanager/impl/post/CreateUserServlet.java   | 104 +++++++---
 .../impl/post/DeleteAuthorizableServlet.java       | 140 +++++++++----
 .../usermanager/impl/post/UpdateGroupServlet.java  |  76 ++++---
 .../usermanager/impl/post/UpdateUserServlet.java   |  64 +++---
 16 files changed, 1043 insertions(+), 215 deletions(-)

diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/ChangeUserPassword.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/ChangeUserPassword.java
new file mode 100644
index 0000000..d98f676
--- /dev/null
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/ChangeUserPassword.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.jackrabbit.usermanager;
+
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.api.security.user.User;
+import org.apache.sling.servlets.post.Modification;
+
+/**
+ * The <code>ChangeUserPassword</code> service api.
+ * <p>
+ * This interface is not intended to be implemented by bundles. It is
+ * implemented by this bundle and may be used by client bundles.
+ * </p>
+ */
+public interface ChangeUserPassword {
+
+	/**
+	 * Update the password of a user in the repository
+	 * 
+	 * @param jcrSession the JCR session of the user updating the user
+	 * @param name The name of the user to update (required)
+	 * @param oldPassword The current password of the user (required for non-admin users)
+	 * @param newPassword The password value to apply (required)
+	 * @param newPasswordConfirm The password value to apply again (required)
+     * @param changes The list of changes for this operation (optional)
+	 * @return the user whose password was changed
+	 * @throws RepositoryException
+	 */
+	public User changePassword(Session jcrSession,
+							String name,
+							String oldPassword,
+							String newPassword,
+							String newPasswordConfirm,
+							List<Modification> changes
+				) throws RepositoryException;
+	
+}
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateGroup.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateGroup.java
new file mode 100644
index 0000000..934e502
--- /dev/null
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateGroup.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.jackrabbit.usermanager;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.api.security.user.Group;
+import org.apache.sling.servlets.post.Modification;
+
+/**
+ * The <code>CreateGroup</code> service api.
+ * <p>
+ * This interface is not intended to be implemented by bundles. It is
+ * implemented by this bundle and may be used by client bundles.
+ * </p>
+ */
+public interface CreateGroup {
+
+	/**
+	 * Create a new group for the repository
+	 * 
+	 * @param jcrSession the JCR session of the user creating the group
+	 * @param name The name of the new group (required)
+	 * @param properties Extra properties to update on the group.  The entry values should be either a String or String[] (optional)
+     * @param changes The list of changes for this operation (optional)
+     * @return the group that was created
+	 * @throws RepositoryException
+	 */
+	public Group createGroup(Session jcrSession,
+							String name,
+							Map<String, ?> properties,
+							List<Modification> changes
+				) throws RepositoryException;
+	
+}
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateUser.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateUser.java
new file mode 100644
index 0000000..51c7b02
--- /dev/null
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/CreateUser.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.jackrabbit.usermanager;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.api.security.user.User;
+import org.apache.sling.servlets.post.Modification;
+
+/**
+ * The <code>CreateUser</code> service api.
+ * <p>
+ * This interface is not intended to be implemented by bundles. It is
+ * implemented by this bundle and may be used by client bundles.
+ * </p>
+ */
+public interface CreateUser {
+
+	/**
+	 * Create a new user for the repository
+	 * 
+	 * @param jcrSession the JCR session of the user creating the user
+	 * @param name The name of the new user (required)
+	 * @param password The password of the new user (required)
+	 * @param password The password of the new user again (required)
+	 * @param properties Extra properties to update on the user.  The entry values should be either a String or String[] (optional)
+     * @param changes The list of changes for this operation (optional)
+	 * @return the user that was created
+	 * @throws RepositoryException
+	 */
+	public User createUser(Session jcrSession,
+							String name,
+							String password,
+							String passwordConfirm,
+							Map<String, ?> properties,
+							List<Modification> changes
+				) throws RepositoryException;
+	
+}
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteAuthorizables.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteAuthorizables.java
new file mode 100644
index 0000000..98f93bf
--- /dev/null
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteAuthorizables.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.jackrabbit.usermanager;
+
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.servlets.post.Modification;
+
+/**
+ * The <code>DeleteAuthorizables</code> service api.
+ * <p>
+ * This interface is not intended to be implemented by bundles. It is
+ * implemented by this bundle and may be used by client bundles.
+ * </p>
+ */
+public interface DeleteAuthorizables {
+
+	/**
+	 * Deletes one or more users or groups from the repository
+	 * 
+	 * @param jcrSession the JCR session of the user creating the user
+	 * @param baseResource the base resource to calculate the relative paths from (required)
+	 * @param paths An array of relative resource paths to Authorizables to be deleted (required)
+     * @param changes The list of changes for this operation (optional)
+	 * @throws RepositoryException
+	 */
+	public void deleteAuthorizables(Session jcrSession,
+							Resource baseResource,
+							String [] paths,
+							List<Modification> changes
+				) throws RepositoryException;
+	
+}
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteGroup.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteGroup.java
new file mode 100644
index 0000000..3c9f9b1
--- /dev/null
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteGroup.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.jackrabbit.usermanager;
+
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.sling.servlets.post.Modification;
+
+/**
+ * The <code>DeleteGroup</code> service api.
+ * <p>
+ * This interface is not intended to be implemented by bundles. It is
+ * implemented by this bundle and may be used by client bundles.
+ * </p>
+ */
+public interface DeleteGroup {
+
+	/**
+	 * Deletes a group from the repository
+	 * 
+	 * @param jcrSession the JCR session of the user creating the user
+	 * @param name The name of the group to delete (required)
+     * @param changes The list of changes for this operation (optional)
+	 * @throws RepositoryException
+	 */
+	public void deleteGroup(Session jcrSession,
+							String name,
+							List<Modification> changes
+				) throws RepositoryException;
+	
+}
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteUser.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteUser.java
new file mode 100644
index 0000000..506ae79
--- /dev/null
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/DeleteUser.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.jackrabbit.usermanager;
+
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.sling.servlets.post.Modification;
+
+/**
+ * The <code>DeleteUser</code> service api.
+ * <p>
+ * This interface is not intended to be implemented by bundles. It is
+ * implemented by this bundle and may be used by client bundles.
+ * </p>
+ */
+public interface DeleteUser {
+
+	/**
+	 * Deletes a user from the repository
+	 * 
+	 * @param jcrSession the JCR session of the user creating the user
+	 * @param name The name of the user to delete (required)
+     * @param changes The list of changes for this operation (optional)
+	 * @throws RepositoryException
+	 */
+	public void deleteUser(Session jcrSession,
+							String name,
+							List<Modification> changes
+				) throws RepositoryException;
+	
+}
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateGroup.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateGroup.java
new file mode 100644
index 0000000..64bdacd
--- /dev/null
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateGroup.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.jackrabbit.usermanager;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.api.security.user.Group;
+import org.apache.sling.servlets.post.Modification;
+
+/**
+ * The <code>UpdateGroup</code> service api.
+ * <p>
+ * This interface is not intended to be implemented by bundles. It is
+ * implemented by this bundle and may be used by client bundles.
+ * </p>
+ */
+public interface UpdateGroup {
+
+	/**
+	 * Update a group in the repository
+	 * 
+	 * @param jcrSession the JCR session of the user creating the group
+	 * @param name The name of the group to update (required)
+	 * @param properties Extra properties to update on the group.  The entry values should be either a String or String[] (optional)
+     * @param changes The list of changes for this operation (optional)
+	 * @return the group that was updated or null if not found
+	 * @throws RepositoryException
+	 */
+	public Group updateGroup(Session jcrSession,
+							String name,
+							Map<String, ?> properties,
+							List<Modification> changes
+				) throws RepositoryException;
+	
+}
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateUser.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateUser.java
new file mode 100644
index 0000000..aac6a0a
--- /dev/null
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/UpdateUser.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.jackrabbit.usermanager;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.api.security.user.User;
+import org.apache.sling.servlets.post.Modification;
+
+/**
+ * The <code>UpdateUser</code> service api.
+ * <p>
+ * This interface is not intended to be implemented by bundles. It is
+ * implemented by this bundle and may be used by client bundles.
+ * </p>
+ */
+public interface UpdateUser {
+
+	/**
+	 * Update a user in the repository
+	 * 
+	 * @param jcrSession the JCR session of the user updating the user
+	 * @param name The name of the user to update (required)
+	 * @param properties Extra properties to update on the user. The entry values should be either a String or String[] (optional)
+     * @param changes The list of changes for this operation (optional)
+     * @return the user that was updated or null if not found 
+	 * @throws RepositoryException
+	 */
+	public User updateUser(Session jcrSession,
+							String name,
+							Map<String, ?> properties,
+							List<Modification> changes
+				) throws RepositoryException;
+	
+}
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java
index 9b7e0e7..d6d743a 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java
@@ -16,12 +16,15 @@
  */
 package org.apache.sling.jackrabbit.usermanager.impl.post;
 
+import java.io.ByteArrayInputStream;
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Dictionary;
-import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -37,6 +40,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
+import org.apache.sling.api.SlingIOException;
 import org.apache.sling.api.request.RequestParameter;
 import org.apache.sling.api.resource.ResourceNotFoundException;
 import org.apache.sling.api.resource.ResourceUtil;
@@ -305,14 +309,14 @@ public abstract class AbstractAuthorizablePostServlet extends
      * @throws ServletException if an internal error occurs
      */
     protected Map<String, RequestProperty> collectContent(
-            SlingHttpServletRequest request, HtmlResponse response,
+            Map<String, ?> properties,
             String authorizablePath) {
 
-        boolean requireItemPrefix = requireItemPathPrefix(request);
+        boolean requireItemPrefix = requireItemPathPrefix(properties);
 
         // walk the request parameters and collect the properties
         Map<String, RequestProperty> reqProperties = new HashMap<String, RequestProperty>();
-        for (Map.Entry<String, RequestParameter[]> e : request.getRequestParameterMap().entrySet()) {
+        for (Map.Entry<String, ?> e : properties.entrySet()) {
             final String paramName = e.getKey();
 
             // do not store parameters with names starting with sling:post
@@ -352,9 +356,9 @@ public abstract class AbstractAuthorizablePostServlet extends
                     reqProperties, propPath,
                     SlingPostConstants.TYPE_HINT_SUFFIX);
 
-                final RequestParameter[] rp = e.getValue();
-                if (rp.length > 0) {
-                    prop.setTypeHintValue(rp[0].getString());
+                String typeHintValue = convertToString(e.getValue());
+                if (typeHintValue != null) {
+                	prop.setTypeHintValue(typeHintValue);
                 }
 
                 continue;
@@ -366,7 +370,7 @@ public abstract class AbstractAuthorizablePostServlet extends
                     reqProperties, propPath,
                     SlingPostConstants.DEFAULT_VALUE_SUFFIX);
 
-                prop.setDefaultValues(e.getValue());
+                prop.setDefaultValues(convertToRequestParameterArray(e.getValue()));
 
                 continue;
             }
@@ -383,9 +387,10 @@ public abstract class AbstractAuthorizablePostServlet extends
                     SlingPostConstants.VALUE_FROM_SUFFIX);
 
                 // @ValueFrom params must have exactly one value, else ignored
-                if (e.getValue().length == 1) {
-                    String refName = e.getValue()[0].getString();
-                    RequestParameter[] refValues = request.getRequestParameters(refName);
+                String [] valueFrom = convertToStringArray(e.getValue());
+                if (valueFrom.length == 1) {
+                    String refName = valueFrom[0];
+                    RequestParameter[] refValues = convertToRequestParameterArray(refName);
                     if (refValues != null) {
                         prop.setValues(refValues);
                     }
@@ -430,7 +435,7 @@ public abstract class AbstractAuthorizablePostServlet extends
             // plain property, create from values
             RequestProperty prop = getOrCreateRequestProperty(reqProperties,
                 propPath, null);
-            prop.setValues(e.getValue());
+            prop.setValues(convertToRequestParameterArray(e.getValue()));
         }
 
         return reqProperties;
@@ -744,17 +749,200 @@ public abstract class AbstractAuthorizablePostServlet extends
      * parameters to be stored.
      */
     protected final boolean requireItemPathPrefix(
-            SlingHttpServletRequest request) {
+            Map<String, ?> properties) {
 
         boolean requirePrefix = false;
 
-        Enumeration<?> names = request.getParameterNames();
-        while (names.hasMoreElements() && !requirePrefix) {
-            String name = (String) names.nextElement();
+        Iterator<String> iterator = properties.keySet().iterator();
+        while (iterator.hasNext() && !requirePrefix) {
+            String name = iterator.next();
             requirePrefix = name.startsWith(SlingPostConstants.ITEM_PREFIX_RELATIVE_CURRENT);
         }
 
         return requirePrefix;
     }
 
+    
+	protected String convertToString(Object obj) {
+		if (obj == null) {
+			return null;
+		}
+		
+		if (obj instanceof String) {
+			return (String)obj;
+		} else if (obj instanceof String[]) {
+			String [] values = (String[])obj;
+			if (values.length > 0) {
+				return values[0];
+			}
+			return null;
+		} else if (obj instanceof RequestParameter) {
+			((RequestParameter)obj).getString();
+		} else if (obj instanceof RequestParameter[]) {
+			RequestParameter[] values = (RequestParameter[])obj;
+			if (values.length > 0) {
+				return values[0].getString();
+			}
+			return null;
+		}
+		return null;
+	}
+    
+	protected String[] convertToStringArray(Object obj) {
+		if (obj == null) {
+			return null;
+		}
+		
+		if (obj instanceof String) {
+			return new String[] {(String)obj};
+		} else if (obj instanceof String[]) {
+			return (String[])obj;
+		} else if (obj instanceof RequestParameter) {
+			return new String[] {((RequestParameter)obj).getString()};
+		} else if (obj instanceof RequestParameter[]) {
+			RequestParameter[] values = (RequestParameter[])obj;
+			String [] strValues = new String[values.length];
+			for (int i=0; i < values.length; i++) {
+				strValues[i] = values[i].getString();
+			}
+			return strValues;
+		}
+		return null;
+	}
+
+	protected RequestParameter[] convertToRequestParameterArray(Object obj) {
+		if (obj == null) {
+			return null;
+		}
+		
+		if (obj instanceof String) {
+			return new RequestParameter[] {
+				new RequestParameterImpl((String)obj, null)	
+			};
+		} else if (obj instanceof String[]) {
+			String [] strValues = (String[])obj;
+			RequestParameter [] values = new RequestParameter[strValues.length];
+			for (int i=0; i < strValues.length; i++) {
+				values[i] = new RequestParameterImpl(strValues[i], null);
+			}
+			return values;
+		} else if (obj instanceof RequestParameter) {
+			return new RequestParameter[] {(RequestParameter)obj};
+		} else if (obj instanceof RequestParameter[]) {
+			return (RequestParameter[])obj;
+		}
+		return null;
+	}
+	
+	static class RequestParameterImpl implements RequestParameter {
+
+	    private String value;
+	    private String encoding;
+
+	    private byte[] content;
+
+	    RequestParameterImpl(String value, String encoding) {
+	    	this.encoding = encoding;
+	        this.value = value;
+	        this.content = null;
+	    }
+
+	    String getEncoding() {
+	        return this.encoding;
+	    }
+	    
+	    void setEncoding(String encoding) {
+	        // recode this parameter by encoding the string with the current
+	        // encoding and decode the bytes with the encoding
+	        try {
+	            this.value = getString(encoding);
+	        } catch (UnsupportedEncodingException uee) {
+	            throw new SlingUnsupportedEncodingException(uee);
+	        }
+	        this.encoding = encoding;
+	    }
+
+	    /**
+	     * @see org.apache.sling.api.request.RequestParameter#get()
+	     */
+	    public byte[] get() {
+	        if (content == null) {
+	            try {
+	                content = getString().getBytes(getEncoding());
+	            } catch (Exception e) {
+	                // UnsupportedEncodingException, IllegalArgumentException
+	                content = getString().getBytes();
+	            }
+	        }
+	        return content;
+	    }
+
+	    /**
+	     * @see org.apache.sling.api.request.RequestParameter#getContentType()
+	     */
+	    public String getContentType() {
+	        // none known for www-form-encoded parameters
+	        return null;
+	    }
+
+	    /**
+	     * @see org.apache.sling.api.request.RequestParameter#getInputStream()
+	     */
+	    public InputStream getInputStream() {
+	        return new ByteArrayInputStream(this.get());
+	    }
+
+	    /**
+	     * @see org.apache.sling.api.request.RequestParameter#getFileName()
+	     */
+	    public String getFileName() {
+	        // no original file name
+	        return null;
+	    }
+
+	    /**
+	     * @see org.apache.sling.api.request.RequestParameter#getSize()
+	     */
+	    public long getSize() {
+	        return this.get().length;
+	    }
+
+	    /**
+	     * @see org.apache.sling.api.request.RequestParameter#getString()
+	     */
+	    public String getString() {
+	        return value;
+	    }
+
+	    /**
+	     * @see org.apache.sling.api.request.RequestParameter#getString(java.lang.String)
+	     */
+	    public String getString(String encoding)
+	            throws UnsupportedEncodingException {
+	        return new String(this.get(), encoding);
+	    }
+
+	    /**
+	     * @see org.apache.sling.api.request.RequestParameter#isFormField()
+	     */
+	    public boolean isFormField() {
+	        // www-form-encoded are always form fields
+	        return true;
+	    }
+
+	    public String toString() {
+	        return this.getString();
+	    }
+	}
+	
+	static class SlingUnsupportedEncodingException extends SlingIOException {
+
+	    private static final long serialVersionUID = -4482276105859280247L;
+
+	    SlingUnsupportedEncodingException(UnsupportedEncodingException uee) {
+	        super(uee);
+	    }
+
+	}
+    
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractGroupPostServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractGroupPostServlet.java
index 57b9dc3..5d10d6c 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractGroupPostServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractGroupPostServlet.java
@@ -17,6 +17,7 @@
 package org.apache.sling.jackrabbit.usermanager.impl.post;
 
 import java.util.List;
+import java.util.Map;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -24,7 +25,6 @@ import javax.jcr.Session;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.UserManager;
-import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
@@ -48,23 +48,24 @@ public abstract class AbstractGroupPostServlet extends
      * @param authorizable
      * @throws RepositoryException
      */
-    protected void updateGroupMembership(SlingHttpServletRequest request,
-            Authorizable authorizable, List<Modification> changes)
+    protected void updateGroupMembership(Resource baseResource,
+    									Map<String, ?> properties,
+							            Authorizable authorizable, 
+							            List<Modification> changes)
             throws RepositoryException {
         if (authorizable.isGroup()) {
             Group group = ((Group) authorizable);
             String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
                 + group.getID();
 
-            ResourceResolver resolver = request.getResourceResolver();
-            Resource baseResource = request.getResource();
+            ResourceResolver resolver = baseResource.getResourceResolver();
             boolean changed = false;
             
             UserManager userManager = AccessControlUtil.getUserManager(resolver.adaptTo(Session.class));
 
             // first remove any members posted as ":member@Delete"
-            String[] membersToDelete = request.getParameterValues(SlingPostConstants.RP_PREFIX
-                + "member" + SlingPostConstants.SUFFIX_DELETE);
+            String[] membersToDelete = convertToStringArray(properties.get(SlingPostConstants.RP_PREFIX
+                + "member" + SlingPostConstants.SUFFIX_DELETE));
             if (membersToDelete != null) {
                 for (String member : membersToDelete) {
                     
@@ -78,8 +79,8 @@ public abstract class AbstractGroupPostServlet extends
             }
 
             // second add any members posted as ":member"
-            String[] membersToAdd = request.getParameterValues(SlingPostConstants.RP_PREFIX
-                + "member");
+            String[] membersToAdd = convertToStringArray(properties.get(SlingPostConstants.RP_PREFIX
+                + "member"));
             if (membersToAdd != null) {
                 for (String member : membersToAdd) {
                     Authorizable memberAuthorizable = getAuthorizable(baseResource, member,userManager,resolver);
@@ -105,21 +106,23 @@ public abstract class AbstractGroupPostServlet extends
      * @param resolver the resource resolver for this request.
      * @return the authorizable, or null if no authorizable was found.
      */
-    private Authorizable getAuthorizable(Resource baseResource, String member, UserManager userManager,
-        ResourceResolver resolver) {
-      Authorizable memberAuthorizable = null;
-      try {
-        memberAuthorizable = userManager.getAuthorizable(member);
-      } catch (RepositoryException e) {
-        // if we can't find the members then it may be resolvable as a resource.
-      }
-      if ( memberAuthorizable == null ) {
-          Resource res = resolver.getResource(baseResource, member);
-          if (res != null) {
-              memberAuthorizable = res.adaptTo(Authorizable.class);
-          }
-      }
-      return memberAuthorizable;
-    }
+	private Authorizable getAuthorizable(Resource baseResource, 
+						    		String member, 
+						    		UserManager userManager,
+						    		ResourceResolver resolver) {
+		Authorizable memberAuthorizable = null;
+		try {
+			memberAuthorizable = userManager.getAuthorizable(member);
+		} catch (RepositoryException e) {
+			// if we can't find the members then it may be resolvable as a resource.
+		}
+		if ( memberAuthorizable == null ) {
+			Resource res = resolver.getResource(baseResource, member);
+			if (res != null) {
+				memberAuthorizable = res.adaptTo(Authorizable.class);
+			}
+		}
+		return memberAuthorizable;
+	}
 
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
index 0bb1b1e..eb31397 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
@@ -33,6 +33,8 @@ import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceNotFoundException;
 import org.apache.sling.api.servlets.HtmlResponse;
 import org.apache.sling.commons.osgi.OsgiUtil;
+import org.apache.sling.jackrabbit.usermanager.ChangeUserPassword;
+import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
 import org.apache.sling.jcr.base.util.AccessControlUtil;
 import org.apache.sling.servlets.post.Modification;
 import org.osgi.service.component.ComponentContext;
@@ -79,11 +81,12 @@ import org.slf4j.LoggerFactory;
  *
  * @scr.component immediate="true"
  * @scr.service interface="javax.servlet.Servlet"
+ * @scr.service interface="org.apache.sling.jackrabbit.usermanager.ChangeUserPassword"
  * @scr.property name="sling.servlet.resourceTypes" value="sling/user"
  * @scr.property name="sling.servlet.methods" value="POST"
  * @scr.property name="sling.servlet.selectors" value="changePassword"
  */
-public class ChangeUserPasswordServlet extends AbstractUserPostServlet {
+public class ChangeUserPasswordServlet extends AbstractUserPostServlet implements ChangeUserPassword {
     private static final long serialVersionUID = 1923614318474654502L;
 
     /**
@@ -137,39 +140,52 @@ public class ChangeUserPasswordServlet extends AbstractUserPostServlet {
     protected void handleOperation(SlingHttpServletRequest request,
             HtmlResponse htmlResponse, List<Modification> changes)
             throws RepositoryException {
-        Authorizable authorizable = null;
+    	
         Resource resource = request.getResource();
-        if (resource != null) {
-            authorizable = resource.adaptTo(Authorizable.class);
-        }
-
-        // check that the user was located.
-        if (authorizable == null || authorizable.isGroup()) {
-            throw new ResourceNotFoundException(
-                "User to update could not be determined.");
-        }
-
-        if ("anonymous".equals(authorizable.getID())) {
+        Session session = request.getResourceResolver().adaptTo(Session.class);
+    	changePassword(session, 
+    			resource.getName(), 
+    			request.getParameter("oldPwd"), 
+    			request.getParameter("newPwd"), 
+    			request.getParameter("newPwdConfirm"), 
+				changes);
+    }
+    
+	/* (non-Javadoc)
+	 * @see org.apache.sling.jackrabbit.usermanager.ChangeUserPassword#changePassword(javax.jcr.Session, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.List)
+	 */
+	public User changePassword(Session jcrSession, 
+								String name,
+								String oldPassword, 
+								String newPassword, 
+								String newPasswordConfirm,
+								List<Modification> changes) 
+				throws RepositoryException {
+		
+        if ("anonymous".equals(name)) {
             throw new RepositoryException(
                 "Can not change the password of the anonymous user.");
         }
-
-        Session session = request.getResourceResolver().adaptTo(Session.class);
-        if (session == null) {
-            throw new RepositoryException("JCR Session not found");
+		
+		User user;
+        UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
+        Authorizable authorizable = userManager.getAuthorizable(name);
+        if (authorizable instanceof User) {
+        	user = (User)authorizable;
+        } else {
+            throw new ResourceNotFoundException(
+            	"User to update could not be determined");
         }
-
+        
     	//SLING-2069: if the current user is an administrator, then a missing oldPwd is ok,
     	// otherwise the oldPwd must be supplied.
         boolean administrator = false;
 
         // check that the submitted parameter values have valid values.
-        String oldPwd = request.getParameter("oldPwd");
-        if (oldPwd == null || oldPwd.length() == 0) {
+        if (oldPassword == null || oldPassword.length() == 0) {
             try {
-                Session currentSession = request.getResourceResolver().adaptTo(Session.class);
-                UserManager um = AccessControlUtil.getUserManager(currentSession);
-                User currentUser = (User) um.getAuthorizable(currentSession.getUserID());
+                UserManager um = AccessControlUtil.getUserManager(jcrSession);
+                User currentUser = (User) um.getAuthorizable(jcrSession.getUserID());
                 administrator = currentUser.isAdmin();
                 
                 if (!administrator) {
@@ -191,30 +207,34 @@ public class ChangeUserPasswordServlet extends AbstractUserPostServlet {
             	throw new RepositoryException("Old Password was not submitted");
             }
         }
-        String newPwd = request.getParameter("newPwd");
-        if (newPwd == null || newPwd.length() == 0) {
+        if (newPassword == null || newPassword.length() == 0) {
             throw new RepositoryException("New Password was not submitted");
         }
-        String newPwdConfirm = request.getParameter("newPwdConfirm");
-        if (!newPwd.equals(newPwdConfirm)) {
+        if (!newPassword.equals(newPasswordConfirm)) {
             throw new RepositoryException(
                 "New Password does not match the confirmation password");
         }
 
-        if (oldPwd != null && oldPwd.length() > 0) {
+        if (oldPassword != null && oldPassword.length() > 0) {
             // verify old password
-            checkPassword(authorizable, oldPwd);
+            checkPassword(authorizable, oldPassword);
         }
 
         try {
-            ((User) authorizable).changePassword(digestPassword(newPwd));
+            ((User) authorizable).changePassword(digestPassword(newPassword));
 
-            changes.add(Modification.onModified(resource.getPath()
+            String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
+            	+ user.getID();
+
+            changes.add(Modification.onModified(userPath
                 + "/rep:password"));
         } catch (RepositoryException re) {
             throw new RepositoryException("Failed to change user password.", re);
         }
-    }
+        
+        return user;
+	}
+    
 
     private void checkPassword(Authorizable authorizable, String oldPassword)
             throws RepositoryException {
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
index 5e2ea88..64fdf48 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
@@ -27,10 +27,14 @@ import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.servlets.HtmlResponse;
 import org.apache.sling.servlets.post.impl.helper.RequestProperty;
+import org.apache.sling.jackrabbit.usermanager.CreateGroup;
 import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
 import org.apache.sling.jcr.base.util.AccessControlUtil;
+import org.apache.sling.jcr.resource.JcrResourceResolverFactory;
 import org.apache.sling.servlets.post.Modification;
 import org.apache.sling.servlets.post.SlingPostConstants;
 
@@ -74,13 +78,17 @@ import org.apache.sling.servlets.post.SlingPostConstants;
  * 
  * @scr.component immediate="true"
  * @scr.service interface="javax.servlet.Servlet"
+ * @scr.service interface="org.apache.sling.jackrabbit.usermanager.CreateGroup"
  * @scr.property name="sling.servlet.resourceTypes" value="sling/groups"
  * @scr.property name="sling.servlet.methods" value="POST"
  * @scr.property name="sling.servlet.selectors" value="create"
  */
-public class CreateGroupServlet extends AbstractGroupPostServlet {
+public class CreateGroupServlet extends AbstractGroupPostServlet implements CreateGroup {
     private static final long serialVersionUID = -1084915263933901466L;
 
+    /** @scr.reference */
+	private JcrResourceResolverFactory resourceResolverFactory;
+    
     /*
      * (non-Javadoc)
      * @see
@@ -93,29 +101,50 @@ public class CreateGroupServlet extends AbstractGroupPostServlet {
             HtmlResponse response, List<Modification> changes)
             throws RepositoryException {
 
-        // check that the submitted parameter values have valid values.
-        final String principalName = request.getParameter(SlingPostConstants.RP_NODE_NAME);
-        if (principalName == null || principalName.length() == 0) {
-            throw new RepositoryException("Group name was not submitted");
+        Session session = request.getResourceResolver().adaptTo(Session.class);
+        String principalName = request.getParameter(SlingPostConstants.RP_NODE_NAME);
+        Group group = createGroup(session, 
+        		principalName, 
+        		request.getRequestParameterMap(), 
+        		changes);
+
+        String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
+        	+ group.getID();
+        response.setPath(groupPath);
+        response.setLocation(externalizePath(request, groupPath));
+        response.setParentLocation(externalizePath(request,
+            AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PATH));
+        
+    }
+	
+	/* (non-Javadoc)
+	 * @see org.apache.sling.jackrabbit.usermanager.CreateGroup#createGroup(javax.jcr.Session, java.lang.String, java.util.Map, java.util.List)
+	 */
+	public Group createGroup(Session jcrSession, final String name,
+			Map<String, ?> properties, List<Modification> changes)
+			throws RepositoryException {
+        // check that the parameter values have valid values.
+		if (jcrSession == null) {
+			throw new IllegalArgumentException("JCR Session not found");
         }
 
-        Session session = request.getResourceResolver().adaptTo(Session.class);
-        if (session == null) {
-            throw new RepositoryException("JCR Session not found");
+        if (name == null || name.length() == 0) {
+            throw new IllegalArgumentException("Group name was not supplied");
         }
 
-        UserManager userManager = AccessControlUtil.getUserManager(session);
-        Authorizable authorizable = userManager.getAuthorizable(principalName);
+        UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
+        Authorizable authorizable = userManager.getAuthorizable(name);
 
+        Group group = null;
         if (authorizable != null) {
             // principal already exists!
             throw new RepositoryException(
-                "A principal already exists with the requested name: "
-                    + principalName);
+                "A group already exists with the requested name: "
+                    + name);
         } else {
-            Group group = userManager.createGroup(new Principal() {
+            group = userManager.createGroup(new Principal() {
                 public String getName() {
-                    return principalName;
+                    return name;
                 }
             });
 
@@ -123,18 +152,27 @@ public class CreateGroupServlet extends AbstractGroupPostServlet {
                 + group.getID();
             
             Map<String, RequestProperty> reqProperties = collectContent(
-                request, response, groupPath);
-            response.setPath(groupPath);
-            response.setLocation(externalizePath(request, groupPath));
-            response.setParentLocation(externalizePath(request,
-                AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PATH));
+                properties, groupPath);
             changes.add(Modification.onCreated(groupPath));
 
             // write content from form
-            writeContent(session, group, reqProperties, changes);
+            writeContent(jcrSession, group, reqProperties, changes);
 
             // update the group memberships
-            updateGroupMembership(request, group, changes);
+            ResourceResolver resourceResolver = null;
+            try {
+            	//create a resource resolver to resolve the relative paths used for group membership values
+                resourceResolver = resourceResolverFactory.getResourceResolver(jcrSession);
+                Resource baseResource = resourceResolver.getResource(AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PATH);
+                updateGroupMembership(baseResource, properties, group, changes);
+            } finally {
+            	if (resourceResolver != null) {
+            		resourceResolver.close();
+            	}
+            }
         }
-    }
+        
+        return group;
+	}
+    
 }
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 551a933..ec95910 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
@@ -31,6 +31,7 @@ import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.servlets.HtmlResponse;
 import org.apache.sling.commons.osgi.OsgiUtil;
 import org.apache.sling.servlets.post.impl.helper.RequestProperty;
+import org.apache.sling.jackrabbit.usermanager.CreateUser;
 import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.jcr.base.util.AccessControlUtil;
@@ -83,11 +84,12 @@ import org.slf4j.LoggerFactory;
  * @scr.component immediate="true" label="%createUser.post.operation.name"
  *                description="%createUser.post.operation.description"
  * @scr.service interface="javax.servlet.Servlet"
+ * @scr.service interface="org.apache.sling.jackrabbit.usermanager.CreateUser"
  * @scr.property name="sling.servlet.resourceTypes" value="sling/users"
  * @scr.property name="sling.servlet.methods" value="POST"
  * @scr.property name="sling.servlet.selectors" value="create"
  */
-public class CreateUserServlet extends AbstractUserPostServlet {
+public class CreateUserServlet extends AbstractUserPostServlet implements CreateUser {
     private static final long serialVersionUID = 6871481922737658675L;
 
     /**
@@ -192,12 +194,44 @@ public class CreateUserServlet extends AbstractUserPostServlet {
             HtmlResponse response, List<Modification> changes)
             throws RepositoryException {
       
+
+        Session session = request.getResourceResolver().adaptTo(Session.class);
+        String principalName = request.getParameter(SlingPostConstants.RP_NODE_NAME);
+    	User user = createUser(session, 
+    						principalName, 
+    						request.getParameter("pwd"),
+    						request.getParameter("pwdConfirm"),
+    						request.getRequestParameterMap(), 
+    						changes);
+    	
+        String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX
+    			+ user.getID();
+        response.setPath(userPath);
+        response.setLocation(externalizePath(request, userPath));
+        response.setParentLocation(externalizePath(request,
+            AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PATH));
+    }
+    
+	/* (non-Javadoc)
+	 * @see org.apache.sling.jackrabbit.usermanager.CreateUser#createUser(javax.jcr.Session, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.util.List)
+	 */
+	public User createUser(Session jcrSession, 
+							String name, 
+							String password,
+							String passwordConfirm, 
+							Map<String, ?> properties,
+							List<Modification> changes) 
+			throws RepositoryException {
+		
+        if (jcrSession == null) {
+            throw new RepositoryException("JCR Session not found");
+        }
+
         // check for an administrator
         boolean administrator = false;
         try {
-            Session currentSession = request.getResourceResolver().adaptTo(Session.class);
-            UserManager um = AccessControlUtil.getUserManager(currentSession);
-            User currentUser = (User) um.getAuthorizable(currentSession.getUserID());
+            UserManager um = AccessControlUtil.getUserManager(jcrSession);
+            User currentUser = (User) um.getAuthorizable(jcrSession.getUserID());
             administrator = currentUser.isAdmin();
             
             if (!administrator) {
@@ -212,7 +246,7 @@ public class CreateUserServlet extends AbstractUserPostServlet {
             	
             }
         } catch ( Exception ex ) {
-            log.warn("Failed to determin if the user is an admin, assuming not. Cause: "+ex.getMessage());
+            log.warn("Failed to determine if the user is an admin, assuming not. Cause: "+ex.getMessage());
             administrator = false;
         }
             
@@ -223,51 +257,46 @@ public class CreateUserServlet extends AbstractUserPostServlet {
                 "Sorry, registration of new users is not currently enabled.  Please try again later.");
         }
 
-        Session session = request.getResourceResolver().adaptTo(Session.class);
-        if (session == null) {
-            throw new RepositoryException("JCR Session not found");
-        }
 
         // check that the submitted parameter values have valid values.
-        String principalName = request.getParameter(SlingPostConstants.RP_NODE_NAME);
-        if (principalName == null || principalName.length() == 0) {
+        if (name == null || name.length() == 0) {
             throw new RepositoryException("User name was not submitted");
         }
-        String pwd = request.getParameter("pwd");
-        if (pwd == null) {
+        if (password == null) {
             throw new RepositoryException("Password was not submitted");
         }
-        String pwdConfirm = request.getParameter("pwdConfirm");
-        if (!pwd.equals(pwdConfirm)) {
+        if (!password.equals(passwordConfirm)) {
             throw new RepositoryException(
                 "Password value does not match the confirmation password");
         }
-
-        Session selfRegSession = null;
+        
+        User user = null;
+        Session selfRegSession = jcrSession;
+        boolean useAdminSession = !administrator && selfRegistrationEnabled;
         try {
-            selfRegSession = getSession();
+            if (useAdminSession) {
+            	//the current user doesn't have permission to create the user,
+            	// but self-registration is enabled, so use an admin session
+            	// to do the work.
+                selfRegSession = getSession();
+            }        	
 
             UserManager userManager = AccessControlUtil.getUserManager(selfRegSession);
-            Authorizable authorizable = userManager.getAuthorizable(principalName);
+            Authorizable authorizable = userManager.getAuthorizable(name);
 
             if (authorizable != null) {
                 // user already exists!
                 throw new RepositoryException(
                     "A principal already exists with the requested name: "
-                        + principalName);
+                        + name);
             } else {
-                User user = userManager.createUser(principalName,
-                    digestPassword(pwd));
+                user = userManager.createUser(name, digestPassword(password));
                 String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX
                     + user.getID();
                 
                 Map<String, RequestProperty> reqProperties = collectContent(
-                    request, response, userPath);
+                    properties, userPath);
 
-                response.setPath(userPath);
-                response.setLocation(externalizePath(request, userPath));
-                response.setParentLocation(externalizePath(request,
-                    AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PATH));
                 changes.add(Modification.onCreated(userPath));
 
                 // write content from form
@@ -276,9 +305,26 @@ public class CreateUserServlet extends AbstractUserPostServlet {
                 if (selfRegSession.hasPendingChanges()) {
                     selfRegSession.save();
                 }
+                
+                if (useAdminSession) {
+                	//lookup the user from the user session so we can return a live object
+                    UserManager userManager2 = AccessControlUtil.getUserManager(jcrSession);
+                    Authorizable authorizable2 = userManager2.getAuthorizable(user.getID());
+                    if (authorizable2 instanceof User) {
+                    	user = (User)authorizable2;
+                    } else {
+                    	user = null;
+                    }
+                }                
             }
         } finally {
-            ungetSession(selfRegSession);
+            if (useAdminSession) {
+            	//done with the self-reg admin session, so clean it up
+                ungetSession(selfRegSession);
+            }        	
         }
-    }
+		
+		return user;
+	}
+    
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java
index 72b9921..1de78f6 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java
@@ -21,14 +21,23 @@ import java.util.List;
 import java.util.NoSuchElementException;
 
 import javax.jcr.RepositoryException;
+import javax.jcr.Session;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.jackrabbit.api.security.user.Authorizable;
+import org.apache.jackrabbit.api.security.user.Group;
+import org.apache.jackrabbit.api.security.user.User;
+import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceNotFoundException;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.servlets.HtmlResponse;
+import org.apache.sling.jackrabbit.usermanager.DeleteAuthorizables;
+import org.apache.sling.jackrabbit.usermanager.DeleteGroup;
+import org.apache.sling.jackrabbit.usermanager.DeleteUser;
+import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
+import org.apache.sling.jcr.base.util.AccessControlUtil;
 import org.apache.sling.servlets.post.Modification;
 import org.apache.sling.servlets.post.SlingPostConstants;
 
@@ -69,12 +78,16 @@ import org.apache.sling.servlets.post.SlingPostConstants;
  *
  * @scr.component metatype="no" immediate="true"
  * @scr.service interface="javax.servlet.Servlet"
+ * @scr.service interface="org.apache.sling.jackrabbit.usermanager.DeleteUser"
+ * @scr.service interface="org.apache.sling.jackrabbit.usermanager.DeleteGroup"
+ * @scr.service interface="org.apache.sling.jackrabbit.usermanager.DeleteAuthorizables"
  * @scr.property name="sling.servlet.resourceTypes" values.0="sling/user"
  *               values.1="sling/group" values.2="sling/userManager"
  * @scr.property name="sling.servlet.methods" value="POST"
  * @scr.property name="sling.servlet.selectors" value="delete"
  */
-public class DeleteAuthorizableServlet extends AbstractAuthorizablePostServlet {
+public class DeleteAuthorizableServlet extends AbstractAuthorizablePostServlet
+		implements DeleteUser, DeleteGroup, DeleteAuthorizables {
     private static final long serialVersionUID = 5874621724096106496L;
 
     /*
@@ -89,54 +102,95 @@ public class DeleteAuthorizableServlet extends AbstractAuthorizablePostServlet {
             HtmlResponse htmlResponse, List<Modification> changes)
             throws RepositoryException {
 
-        Iterator<Resource> res = getApplyToResources(request);
-        if (res == null) {
-            Resource resource = request.getResource();
+        Session session = request.getResourceResolver().adaptTo(Session.class);
+        Resource resource = request.getResource();
+        String[] applyTo = request.getParameterValues(SlingPostConstants.RP_APPLY_TO);
+        if (applyTo != null) {
+        	deleteAuthorizables(session,
+        			resource,
+        			applyTo, 
+        			changes);
+        } else {
             Authorizable item = resource.adaptTo(Authorizable.class);
             if (item == null) {
                 String msg = "Missing source " + resource.getPath()
                     + " for delete";
                 htmlResponse.setStatus(HttpServletResponse.SC_NOT_FOUND, msg);
                 throw new ResourceNotFoundException(msg);
-            }
-
-            item.remove();
-            changes.add(Modification.onDeleted(resource.getPath()));
-        } else {
-            while (res.hasNext()) {
-                Resource resource = res.next();
-                Authorizable item = resource.adaptTo(Authorizable.class);
-                if (item != null) {
-                    item.remove();
-                    changes.add(Modification.onDeleted(resource.getPath()));
-                }
+            } else {
+            	if (item instanceof User) {
+            		deleteUser(session, item.getID(), changes);
+            	} else if (item instanceof Group) {
+            		deleteGroup(session, item.getID(), changes);
+            	}
             }
         }
     }
-
-    /**
-     * Returns an iterator on <code>Resource</code> instances addressed in the
-     * {@link SlingPostConstants#RP_APPLY_TO} request parameter. If the request
-     * parameter is not set, <code>null</code> is returned. If the parameter is
-     * set with valid resources an empty iterator is returned. Any resources
-     * addressed in the {@link SlingPostConstants#RP_APPLY_TO} parameter is
-     * ignored.
-     *
-     * @param request The <code>SlingHttpServletRequest</code> object used to
-     *            get the {@link SlingPostConstants#RP_APPLY_TO} parameter.
-     * @return The iterator of resources listed in the parameter or
-     *         <code>null</code> if the parameter is not set in the request.
-     */
-    protected Iterator<Resource> getApplyToResources(
-            SlingHttpServletRequest request) {
-
-        String[] applyTo = request.getParameterValues(SlingPostConstants.RP_APPLY_TO);
-        if (applyTo == null) {
-            return null;
+    
+	/* (non-Javadoc)
+	 * @see org.apache.sling.jackrabbit.usermanager.DeleteUser#deleteUser(javax.jcr.Session, java.lang.String, java.util.List)
+	 */
+	public void deleteUser(Session jcrSession, String name,
+			List<Modification> changes) throws RepositoryException {
+
+		User user;
+		UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
+        Authorizable authorizable = userManager.getAuthorizable(name);
+        if (authorizable instanceof User) {
+        	user = (User)authorizable;
+        } else {
+            throw new ResourceNotFoundException(
+        		"User to delete could not be determined");
         }
-
-        return new ApplyToIterator(request, applyTo);
-    }
+        
+        String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX
+							+ user.getID();
+        user.remove();
+        changes.add(Modification.onDeleted(userPath));
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.apache.sling.jackrabbit.usermanager.DeleteGroup#deleteGroup(javax.jcr.Session, java.lang.String, java.util.List)
+	 */
+	public void deleteGroup(Session jcrSession, 
+							String name,
+							List<Modification> changes) throws RepositoryException {
+
+		Group group;
+		UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
+        Authorizable authorizable = userManager.getAuthorizable(name);
+        if (authorizable instanceof Group) {
+        	group = (Group)authorizable;
+        } else {
+            throw new ResourceNotFoundException(
+        		"Group to delete could not be determined");
+        }
+        
+        String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
+								+ group.getID();
+        group.remove();
+        changes.add(Modification.onDeleted(groupPath));
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.sling.jackrabbit.usermanager.DeleteAuthorizables#deleteAuthorizables(javax.jcr.Session, org.apache.sling.api.resource.Resource, java.lang.String[], java.util.List)
+	 */
+	public void deleteAuthorizables(Session jcrSession, 
+									Resource baseResource,
+									String[] paths, 
+									List<Modification> changes)
+			throws RepositoryException {
+
+		ApplyToIterator iterator = new ApplyToIterator(baseResource, paths);
+        while (iterator.hasNext()) {
+            Resource resource = iterator.next();
+            Authorizable item = resource.adaptTo(Authorizable.class);
+            if (item != null) {
+                item.remove();
+                changes.add(Modification.onDeleted(resource.getPath()));
+            }
+        }
+	}
 
     private static class ApplyToIterator implements Iterator<Resource> {
 
@@ -144,15 +198,15 @@ public class DeleteAuthorizableServlet extends AbstractAuthorizablePostServlet {
 
         private final Resource baseResource;
 
-        private final String[] paths;
+        private final String [] paths;
 
         private int pathIndex;
 
         private Resource nextResource;
 
-        ApplyToIterator(SlingHttpServletRequest request, String[] paths) {
-            this.resolver = request.getResourceResolver();
-            this.baseResource = request.getResource();
+        ApplyToIterator(Resource baseResource, String [] paths) {
+            this.resolver = baseResource.getResourceResolver();
+            this.baseResource = baseResource;
             this.paths = paths;
             this.pathIndex = 0;
 
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java
index e9de57c..461e8e7 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java
@@ -23,13 +23,19 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
 import org.apache.jackrabbit.api.security.user.Authorizable;
+import org.apache.jackrabbit.api.security.user.Group;
+import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceNotFoundException;
+import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.servlets.HtmlResponse;
-import org.apache.sling.servlets.post.impl.helper.RequestProperty;
+import org.apache.sling.jackrabbit.usermanager.UpdateGroup;
 import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
+import org.apache.sling.jcr.base.util.AccessControlUtil;
+import org.apache.sling.jcr.resource.JcrResourceResolverFactory;
 import org.apache.sling.servlets.post.Modification;
+import org.apache.sling.servlets.post.impl.helper.RequestProperty;
 
 /**
  * <p>
@@ -72,13 +78,18 @@ import org.apache.sling.servlets.post.Modification;
  *
  * @scr.component metatype="no" immediate="true"
  * @scr.service interface="javax.servlet.Servlet"
+ * @scr.service interface="org.apache.sling.jackrabbit.usermanager.UpdateGroup"
  * @scr.property name="sling.servlet.resourceTypes" values="sling/group"
  * @scr.property name="sling.servlet.methods" value="POST"
  * @scr.property name="sling.servlet.selectors" value="update"
  */
-public class UpdateGroupServlet extends AbstractGroupPostServlet {
+public class UpdateGroupServlet extends AbstractGroupPostServlet 
+		implements UpdateGroup {
     private static final long serialVersionUID = -8292054361992488797L;
 
+    /** @scr.reference */
+	private JcrResourceResolverFactory resourceResolverFactory;
+    
     /*
      * (non-Javadoc)
      * @see
@@ -90,41 +101,60 @@ public class UpdateGroupServlet extends AbstractGroupPostServlet {
     protected void handleOperation(SlingHttpServletRequest request,
             HtmlResponse htmlResponse, List<Modification> changes)
             throws RepositoryException {
-        Authorizable authorizable = null;
         Resource resource = request.getResource();
-        if (resource != null) {
-            authorizable = resource.adaptTo(Authorizable.class);
-        }
+        Session session = request.getResourceResolver().adaptTo(Session.class);
+        updateGroup(session,
+        				resource.getName(),
+        				request.getRequestParameterMap(), 
+        				changes);
+    }
+    
+	/* (non-Javadoc)
+	 * @see org.apache.sling.jackrabbit.usermanager.UpdateGroup#updateGroup(javax.jcr.Session, java.lang.String, java.util.Map, java.util.List)
+	 */
+	public Group updateGroup(Session jcrSession, 
+								String name,
+								Map<String, ?> properties, 
+								List<Modification> changes)
+			throws RepositoryException {
 
-        // check that the group was located.
-        if (authorizable == null) {
+		Group group = null;
+        UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
+        Authorizable authorizable = userManager.getAuthorizable(name);
+        if (authorizable instanceof Group) {
+        	group = (Group)authorizable;
+        } else {
             throw new ResourceNotFoundException(
-                "Group to update could not be determined");
+            	"Group to update could not be determined");
         }
-
-        Session session = request.getResourceResolver().adaptTo(Session.class);
-        if (session == null) {
-            throw new RepositoryException("JCR Session not found");
-        }
-        
+		
         String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
-            + authorizable.getID();
+            + group.getID();
 
-        Map<String, RequestProperty> reqProperties = collectContent(request,
-            htmlResponse, groupPath);
+        Map<String, RequestProperty> reqProperties = collectContent(properties, groupPath);
         try {
             // cleanup any old content (@Delete parameters)
-            processDeletes(authorizable, reqProperties, changes);
+            processDeletes(group, reqProperties, changes);
 
             // write content from form
-            writeContent(session, authorizable, reqProperties, changes);
+            writeContent(jcrSession, group, reqProperties, changes);
 
             // update the group memberships
-            if (authorizable.isGroup()) {
-                updateGroupMembership(request, authorizable, changes);
+            ResourceResolver resourceResolver = null;
+            try {
+            	//create a resource resolver to resolve the relative paths used for group membership values
+                resourceResolver = resourceResolverFactory.getResourceResolver(jcrSession);
+                Resource baseResource = resourceResolver.getResource(groupPath);
+                updateGroupMembership(baseResource, properties, group, changes);
+            } finally {
+            	if (resourceResolver != null) {
+            		resourceResolver.close();
+            	}
             }
         } catch (RepositoryException re) {
             throw new RepositoryException("Failed to update group.", re);
         }
-    }
+        return group;
+	}
+    
 }
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
index 31210b5..13915a8 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
@@ -22,12 +22,16 @@ import java.util.Map;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
+import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.User;
+import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceNotFoundException;
 import org.apache.sling.api.servlets.HtmlResponse;
+import org.apache.sling.jackrabbit.usermanager.UpdateUser;
 import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
+import org.apache.sling.jcr.base.util.AccessControlUtil;
 import org.apache.sling.servlets.post.Modification;
 import org.apache.sling.servlets.post.impl.helper.RequestProperty;
 
@@ -73,11 +77,13 @@ import org.apache.sling.servlets.post.impl.helper.RequestProperty;
  *
  * @scr.component metatype="no" immediate="true"
  * @scr.service interface="javax.servlet.Servlet"
+ * @scr.service interface="org.apache.sling.jackrabbit.usermanager.UpdateUser"
  * @scr.property name="sling.servlet.resourceTypes" value="sling/user"
  * @scr.property name="sling.servlet.methods" value="POST"
  * @scr.property name="sling.servlet.selectors" value="update"
  */
-public class UpdateUserServlet extends AbstractUserPostServlet {
+public class UpdateUserServlet extends AbstractUserPostServlet 
+		implements UpdateUser {
     private static final long serialVersionUID = 5874621724096106496L;
 
     /*
@@ -91,51 +97,59 @@ public class UpdateUserServlet extends AbstractUserPostServlet {
     protected void handleOperation(SlingHttpServletRequest request,
             HtmlResponse htmlResponse, List<Modification> changes)
             throws RepositoryException {
-        User authorizable = null;
         Resource resource = request.getResource();
-        if (resource != null) {
-            authorizable = resource.adaptTo(User.class);
-        }
-
-        // check that the group was located.
-        if (authorizable == null) {
-            throw new ResourceNotFoundException(
-                "User to update could not be determined");
-        }
-
         Session session = request.getResourceResolver().adaptTo(Session.class);
-        if (session == null) {
-            throw new RepositoryException("JCR Session not found");
+        updateUser(session,
+        		resource.getName(),
+				request.getRequestParameterMap(), 
+				changes);
+    }
+    
+	/* (non-Javadoc)
+	 * @see org.apache.sling.jackrabbit.usermanager.UpdateUser#updateUser(javax.jcr.Session, java.lang.String, java.util.Map, java.util.List)
+	 */
+	public User updateUser(Session jcrSession, String name,
+			Map<String, ?> properties, List<Modification> changes)
+			throws RepositoryException {
+        
+		User user;
+        UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
+        Authorizable authorizable = userManager.getAuthorizable(name);
+        if (authorizable instanceof User) {
+        	user = (User)authorizable;
+        } else {
+            throw new ResourceNotFoundException(
+            	"User to update could not be determined");
         }
         
         String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
-            + authorizable.getID();
+            + user.getID();
 
-        Map<String, RequestProperty> reqProperties = collectContent(request,
-            htmlResponse, userPath);
+        Map<String, RequestProperty> reqProperties = collectContent(properties, userPath);
         try {
             // cleanup any old content (@Delete parameters)
-            processDeletes(authorizable, reqProperties, changes);
+            processDeletes(user, reqProperties, changes);
 
             // write content from form
-            writeContent(session, authorizable, reqProperties, changes);
+            writeContent(jcrSession, user, reqProperties, changes);
             
             //SLING-2072 set the user as enabled or disabled if the request
-            // has supplied the relev
-            String disabledParam = request.getParameter(":disabled");
+            // has supplied the relevant properties
+            String disabledParam = convertToString(properties.get(":disabled"));
             if ("true".equalsIgnoreCase(disabledParam)) {
             	//set the user as disabled
-            	String disabledReason = request.getParameter(":disabledReason");
+            	String disabledReason = convertToString(properties.get(":disabledReason"));
             	if (disabledReason == null) {
             		disabledReason = "";
             	}
-            	authorizable.disable(disabledReason);
+            	user.disable(disabledReason);
             } else if ("false".equalsIgnoreCase(disabledParam)) {
             	//re-enable a disabled user
-            	authorizable.disable(null);
+            	user.disable(null);
             }
         } catch (RepositoryException re) {
             throw new RepositoryException("Failed to update user.", re);
         }
-    }
+        return user;
+	}    
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.