You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by en...@apache.org on 2018/09/08 22:40:12 UTC

[sling-org-apache-sling-jcr-jackrabbit-usermanager] branch master updated: SLING-7901 Update User/Group delete nested property does not work

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

enorman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git


The following commit(s) were added to refs/heads/master by this push:
     new 06c81b2  SLING-7901 Update User/Group delete nested property does not work
06c81b2 is described below

commit 06c81b2d82306ebb517abfe73102893e2a122f6b
Author: Eric Norman <en...@apache.org>
AuthorDate: Sat Sep 8 15:40:04 2018 -0700

    SLING-7901 Update User/Group delete nested property does not work
---
 .../usermanager/impl/post/AbstractAuthorizablePostServlet.java   | 9 ++++++---
 1 file changed, 6 insertions(+), 3 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 02bdd4e..f136ff0 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
@@ -262,9 +262,12 @@ public abstract class AbstractAuthorizablePostServlet extends
 
         for (RequestProperty property : reqProperties) {
             if (property.isDelete()) {
-                if (authorizable.hasProperty(property.getName())) {
-                    authorizable.removeProperty(property.getName());
-                    changes.add(Modification.onDeleted(property.getPath()));
+                // SLING-7901 - remove artificial "/" prepended to the prop path
+                String relativePath = property.getPath().substring(1);
+            	
+                if (authorizable.hasProperty(relativePath)) {
+                    authorizable.removeProperty(relativePath);
+                    changes.add(Modification.onDeleted(relativePath));
                 }
             }
         }