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:29 UTC

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

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


      at a76463f  (tag)
 tagging e59100f105cfecbdfc22b0d9572dabd982496410 (commit)
      by Justin Edelson
      on Wed Nov 3 17:56:57 2010 +0000

- Log -----------------------------------------------------------------
org.apache.sling.jcr.jackrabbit.usermanager-2.1.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 e59100f  [maven-scm] copy for tag org.apache.sling.jcr.jackrabbit.usermanager-2.1.0

The 61 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] 03/24: SLING-1379 Support adapt to User and Group

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

commit e9b4cac7a81a9c611798fd895fb275428c292c5e
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Tue Feb 16 10:46:40 2010 +0000

    SLING-1379  Support adapt to User and Group
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@910461 13f79535-47bb-0310-9956-ffa450edef68
---
 .../jackrabbit/usermanager/impl/resource/AuthorizableResource.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResource.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResource.java
index 9d44008..56b4930 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResource.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResource.java
@@ -21,6 +21,8 @@ import java.util.Map;
 import javax.jcr.RepositoryException;
 
 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.sling.adapter.SlingAdaptable;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceMetadata;
@@ -107,7 +109,9 @@ public class AuthorizableResource extends SlingAdaptable implements Resource {
         if (type == Map.class || type == ValueMap.class) {
             return (AdapterType) new AuthorizableValueMap(authorizable); // unchecked
                                                                          // cast
-        } else if (type == Authorizable.class) {
+        } else if (type == Authorizable.class
+            || (type == User.class && !authorizable.isGroup())
+            || (type == Group.class && authorizable.isGroup())) {
             return (AdapterType) authorizable;
         }
 

-- 
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-1578 reduce code duplication between post servlet and usermanager

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

commit 7f905a7ab07f96f1e83e2d7d851938e41b5d3156
Author: Eric Norman <en...@apache.org>
AuthorDate: Sun Aug 8 15:31:36 2010 +0000

    SLING-1578 reduce code duplication between post servlet and usermanager
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@983427 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |   4 +
 .../usermanager/impl/helper/DateParser.java        | 141 ------------
 .../usermanager/impl/helper/RequestProperty.java   | 256 ---------------------
 .../impl/post/AbstractAuthorizablePostServlet.java |   4 +-
 .../usermanager/impl/post/CreateGroupServlet.java  |   2 +-
 .../usermanager/impl/post/CreateUserServlet.java   |   2 +-
 .../usermanager/impl/post/UpdateGroupServlet.java  |   2 +-
 .../usermanager/impl/post/UpdateUserServlet.java   |   2 +-
 8 files changed, 10 insertions(+), 403 deletions(-)

diff --git a/pom.xml b/pom.xml
index 86f2168..ef4f7b7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,6 +66,10 @@
                         <Private-Package>
                             org.apache.sling.jackrabbit.usermanager.impl.*
                         </Private-Package>
+                        <Embed-Dependency>
+                            org.apache.sling.servlets.post;inline="org/apache/sling/servlets/post/impl/helper/RequestProperty*
+                                |org/apache/sling/servlets/post/impl/helper/DateParser*"
+                        </Embed-Dependency>
                     </instructions>
                 </configuration>
             </plugin>
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/helper/DateParser.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/helper/DateParser.java
deleted file mode 100644
index e67c5df..0000000
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/helper/DateParser.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * 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.helper;
-
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-
-import javax.jcr.Value;
-import javax.jcr.ValueFactory;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Takes a string representation of a time-date string and tries for parse it
- * using different formats.
- */
-public class DateParser {
-
-    /**
-     * default log
-     */
-    private static final Logger log = LoggerFactory.getLogger(DateParser.class);
-
-    /**
-     * lits of formats
-     */
-    private final List<DateFormat> formats = new LinkedList<DateFormat>();
-
-    /**
-     * Registers a format string to the list of internally checked ones. Uses
-     * the {@link SimpleDateFormat}.
-     * 
-     * @param format format as in {@link SimpleDateFormat}
-     * @throws IllegalArgumentException if the format is not valid.
-     */
-    public void register(String format) {
-        register(new SimpleDateFormat(format, Locale.US));
-    }
-
-    /**
-     * Registers a date format to the list of internally checked ones.
-     * 
-     * @param format date format
-     */
-    public void register(DateFormat format) {
-        formats.add(format);
-    }
-
-    /**
-     * Parses the given source string and returns the respective calendar
-     * instance. If no format matches returns <code>null</code>.
-     * <p/>
-     * Note: method is synchronized because SimpleDateFormat is not.
-     * 
-     * @param source date time source string
-     * @return calendar representation of the source or <code>null</code>
-     */
-    public synchronized Calendar parse(String source) {
-        for (DateFormat fmt : formats) {
-            try {
-                Date d = fmt.parse(source);
-                if (log.isDebugEnabled()) {
-                    log.debug("Parsed " + source + " using " + fmt + " into "
-                        + d);
-                }
-                Calendar c = Calendar.getInstance();
-                c.setTime(d);
-                return c;
-            } catch (ParseException e) {
-                if (log.isDebugEnabled()) {
-                    log.debug("Failed parsing " + source + " using " + fmt);
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Parses the given source strings and returns the respective calendar
-     * instances. If no format matches for any of the sources returns
-     * <code>null</code>.
-     * <p/>
-     * Note: method is synchronized because SimpleDateFormat is not.
-     * 
-     * @param sources date time source strings
-     * @return calendar representations of the source or <code>null</code>
-     */
-    public synchronized Calendar[] parse(String sources[]) {
-        Calendar ret[] = new Calendar[sources.length];
-        for (int i = 0; i < sources.length; i++) {
-            if ((ret[i] = parse(sources[i])) == null) {
-                return null;
-            }
-        }
-        return ret;
-    }
-
-    /**
-     * Parses the given source strings and returns the respective jcr date value
-     * instances. If no format matches for any of the sources returns
-     * <code>null</code>.
-     * <p/>
-     * Note: method is synchronized because SimpleDateFormat is not.
-     * 
-     * @param sources date time source strings
-     * @param factory the value factory
-     * @return jcr date value representations of the source or <code>null</code>
-     */
-    public synchronized Value[] parse(String sources[], ValueFactory factory) {
-        Value ret[] = new Value[sources.length];
-        for (int i = 0; i < sources.length; i++) {
-            Calendar c = parse(sources[i]);
-            if (c == null) {
-                return null;
-            }
-            ret[i] = factory.createValue(c);
-        }
-        return ret;
-    }
-}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/helper/RequestProperty.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/helper/RequestProperty.java
deleted file mode 100644
index 8a99c1d..0000000
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/helper/RequestProperty.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * 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.helper;
-
-import org.apache.sling.api.request.RequestParameter;
-import org.apache.sling.api.resource.ResourceUtil;
-import org.apache.sling.servlets.post.SlingPostConstants;
-
-/**
- * This is a copy of the class from 'org.apache.sling.servlets.post.impl.helper'
- * which is not exported. Encapsulates all infos from the respective request
- * parameters that are needed to create the repository property
- */
-public class RequestProperty {
-
-    private static final RequestParameter[] EMPTY_PARAM_ARRAY = new RequestParameter[0];
-
-    public static final String DEFAULT_IGNORE = SlingPostConstants.RP_PREFIX
-        + "ignore";
-
-    public static final String DEFAULT_NULL = SlingPostConstants.RP_PREFIX
-        + "null";
-
-    private final String path;
-
-    private final String name;
-
-    private final String parentPath;
-
-    private RequestParameter[] values;
-
-    private String[] stringValues;
-
-    private String typeHint;
-
-    private boolean hasMultiValueTypeHint;
-
-    private RequestParameter[] defaultValues = EMPTY_PARAM_ARRAY;
-
-    private boolean isDelete;
-
-    private String repositoryResourcePath;
-
-    private boolean isRepositoryResourceMove;
-
-    public RequestProperty(String path) {
-        assert path.startsWith("/");
-        this.path = ResourceUtil.normalize(path);
-        this.parentPath = ResourceUtil.getParent(path);
-        this.name = ResourceUtil.getName(path);
-    }
-
-    public String getTypeHint() {
-        return typeHint;
-    }
-
-    public boolean hasMultiValueTypeHint() {
-        return this.hasMultiValueTypeHint;
-    }
-
-    public void setTypeHintValue(String typeHint) {
-        if (typeHint != null && typeHint.endsWith("[]")) {
-            this.typeHint = typeHint.substring(0, typeHint.length() - 2);
-            this.hasMultiValueTypeHint = true;
-        } else {
-            this.typeHint = typeHint;
-            this.hasMultiValueTypeHint = false;
-        }
-    }
-
-    public String getPath() {
-        return path;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public String getParentPath() {
-        return parentPath;
-    }
-
-    public boolean hasValues() {
-        return values != null;
-    }
-
-    public RequestParameter[] getValues() {
-        return values;
-    }
-
-    public void setValues(RequestParameter[] values) {
-        this.values = values;
-    }
-
-    public RequestParameter[] getDefaultValues() {
-        return defaultValues;
-    }
-
-    public void setDefaultValues(RequestParameter[] defaultValues) {
-        if (defaultValues == null) {
-            this.defaultValues = EMPTY_PARAM_ARRAY;
-        } else {
-            this.defaultValues = defaultValues;
-        }
-    }
-
-    public boolean isFileUpload() {
-        return !values[0].isFormField();
-    }
-
-    /**
-     * Checks if this property provides any values. this is the case if one of
-     * the values is not empty or if the default handling is not 'ignore'
-     * 
-     * @return <code>true</code> if this property provides values
-     */
-    public boolean providesValue() {
-        // should void double creation of string values
-        String[] sv = getStringValues();
-        if (sv == null) {
-            // is missleading return type. but means that property should not
-            // get auto-create values
-            return true;
-        }
-        for (String s : sv) {
-            if (!s.equals("")) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Returns the assembled string array out of the provided request values and
-     * default values.
-     * 
-     * @return a String array or <code>null</code> if the property needs to be
-     *         removed.
-     */
-    public String[] getStringValues() {
-        if (stringValues == null) {
-            if (values.length > 1) {
-                // TODO: how the default values work for MV props is not very
-                // clear
-                stringValues = new String[values.length];
-                for (int i = 0; i < stringValues.length; i++) {
-                    stringValues[i] = values[i].getString();
-                }
-            } else {
-                String value = values[0].getString();
-                if (value.equals("")) {
-                    if (defaultValues.length == 1) {
-                        String defValue = defaultValues[0].getString();
-                        if (defValue.equals(DEFAULT_IGNORE)) {
-                            // ignore means, do not create empty values
-                            return new String[0];
-                        } else if (defValue.equals(DEFAULT_NULL)) {
-                            // null means, remove property if exist
-                            return null;
-                        }
-                        value = defValue;
-                    }
-                }
-                stringValues = new String[] { value };
-            }
-        }
-        return stringValues;
-    }
-
-    /**
-     * Specifies whether this property should be deleted before any new content
-     * is to be set according to the values stored.
-     * 
-     * @param isDelete <code>true</code> if the repository item described by
-     *            this is to be deleted before any other operation.
-     */
-    public void setDelete(boolean isDelete) {
-        this.isDelete = isDelete;
-    }
-
-    /**
-     * Returns <code>true</code> if the repository item described by this is to
-     * be deleted before setting new content to it.
-     */
-    public boolean isDelete() {
-        return isDelete;
-    }
-
-    /**
-     * Sets the path of the repository item from which the content for this
-     * property is to be copied or moved. The path may be relative in which case
-     * it will be resolved relative to the absolute path of this property.
-     * 
-     * @param sourcePath The path of the repository item to get the content from
-     * @param isMove <code>true</code> if the source content is to be moved,
-     *            otherwise the source content is copied from the repository
-     *            item.
-     */
-    public void setRepositorySource(String sourcePath, boolean isMove) {
-
-        // make source path absolute
-        if (!sourcePath.startsWith("/")) {
-            sourcePath = getParentPath() + "/" + sourcePath;
-            sourcePath = ResourceUtil.normalize(sourcePath);
-        }
-
-        this.repositoryResourcePath = sourcePath;
-        this.isRepositoryResourceMove = isMove;
-    }
-
-    /**
-     * Returns <code>true</code> if the content of this property is to be set by
-     * moving content from another repository item.
-     * 
-     * @see #getRepositorySource()
-     */
-    public boolean hasRepositoryMoveSource() {
-        return isRepositoryResourceMove;
-    }
-
-    /**
-     * Returns <code>true</code> if the content of this property is to be set by
-     * copying content from another repository item.
-     * 
-     * @see #getRepositorySource()
-     */
-    public boolean hasRepositoryCopySource() {
-        return getRepositorySource() != null && !hasRepositoryMoveSource();
-    }
-
-    /**
-     * Returns the absolute path of the repository item from which the content
-     * for this property is to be copied or moved.
-     * 
-     * @see #hasRepositoryCopySource()
-     * @see #hasRepositoryMoveSource()
-     * @see #setRepositorySource(String, boolean)
-     */
-    public String getRepositorySource() {
-        return repositoryResourcePath;
-    }
-}
\ No newline at end of file
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 fccf282..315f636 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
@@ -44,8 +44,8 @@ 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.helper.DateParser;
-import org.apache.sling.jackrabbit.usermanager.impl.helper.RequestProperty;
+import org.apache.sling.servlets.post.impl.helper.DateParser;
+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.SlingPostConstants;
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 5a63b07..5a24c84 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
@@ -28,7 +28,7 @@ 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.servlets.HtmlResponse;
-import org.apache.sling.jackrabbit.usermanager.impl.helper.RequestProperty;
+import org.apache.sling.servlets.post.impl.helper.RequestProperty;
 import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
 import org.apache.sling.jcr.base.util.AccessControlUtil;
 import org.apache.sling.servlets.post.Modification;
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 f983d15..c5f102d 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
@@ -28,7 +28,7 @@ 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.jackrabbit.usermanager.impl.helper.RequestProperty;
+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;
 import org.apache.sling.jcr.base.util.AccessControlUtil;
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 c4ed8f2..e9de57c 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
@@ -27,7 +27,7 @@ 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.impl.helper.RequestProperty;
+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;
 
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 a65dfbd..cf908a3 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
@@ -27,7 +27,7 @@ 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.impl.helper.RequestProperty;
+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;
 

-- 
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: Use latest Sling API release

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

commit b195421405a55c0e6e496501b5676241a99711b9
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Aug 23 17:25:06 2010 +0000

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

diff --git a/pom.xml b/pom.xml
index ef4f7b7..6768e00 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,7 +84,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
-            <version>2.0.9-SNAPSHOT</version>
+            <version>2.1.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</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] 07/24: SLING-1453 Provide AuthorizablePrivilegesInfo service to help user/group management scripts query what the current user is allowed to do

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

commit c06d6a5e85a512a9a726ec7cfad61dc8ce154089
Author: Eric Norman <en...@apache.org>
AuthorDate: Fri Mar 19 19:31:12 2010 +0000

    SLING-1453 Provide AuthorizablePrivilegesInfo service to help user/group management scripts query what the current user is allowed to do
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@925392 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |   5 +-
 .../usermanager/AuthorizablePrivilegesInfo.java    |  58 ++++
 .../impl/AuthorizablePrivilegesInfoImpl.java       | 306 +++++++++++++++++++++
 3 files changed, 368 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 89411b9..262b189 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,8 +60,11 @@
                 <extensions>true</extensions>
                 <configuration>
                     <instructions>
+						<Export-Package>
+                            org.apache.sling.jackrabbit.usermanager;version=${pom.version},
+						</Export-Package>
                         <Private-Package>
-                            org.apache.sling.jackrabbit.usermanager.*
+                            org.apache.sling.jackrabbit.usermanager.impl.*
                         </Private-Package>
                     </instructions>
                 </configuration>
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/AuthorizablePrivilegesInfo.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/AuthorizablePrivilegesInfo.java
new file mode 100644
index 0000000..5ccb119
--- /dev/null
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/AuthorizablePrivilegesInfo.java
@@ -0,0 +1,58 @@
+package org.apache.sling.jackrabbit.usermanager;
+
+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 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);
+
+}
\ No newline at end of file
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
new file mode 100644
index 0000000..f158c9a
--- /dev/null
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
@@ -0,0 +1,306 @@
+/*
+ * 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;
+
+import java.io.UnsupportedEncodingException;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.util.Dictionary;
+
+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.commons.osgi.OsgiUtil;
+import org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo;
+import org.apache.sling.jcr.base.util.AccessControlUtil;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Helper class to assist in the usage of access control of users/groups from scripts.
+ * 
+ * The default access control policy defined by this provider has the following
+ * characteristics:
+ * <ul>
+ * <li>everybody has READ permission to all items,</li>
+ *
+ * <li>every known user is allowed to modify it's own properties except for
+ * her/his group membership,</li>
+ *
+ * <li>members of the 'User administrator' group are allowed to create, modify
+ * and remove users,</li>
+ *
+ * <li>members of the 'Group administrator' group are allowed to create, modify
+ * and remove groups,</li>
+ *
+ * <li>group membership can only be edited by members of the 'Group administrator'
+ * and the 'User administrator' group.</li>
+ * </ul>
+ * 
+ * @scr.component immediate="true" metatype="no"
+ * @scr.service
+ *
+ * @scr.property name="service.description" value="User/Group Privileges Information"
+ * @scr.property name="service.vendor" value="The Apache Software Foundation"
+ */
+public class AuthorizablePrivilegesInfoImpl implements AuthorizablePrivilegesInfo {
+
+    /** default log */
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    /**
+     * 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 name of the configuration parameter providing the 
+     * 'Group administrator' group name.
+     *
+     * @scr.property valueRef="DEFAULT_GROUP_ADMIN_GROUP_NAME"
+     */
+    private static final String PAR_GROUP_ADMIN_GROUP_NAME = "group.admin.group.name";
+
+    /**
+     * The default 'User administrator' group name
+     *
+     * @see #PAR_GROUP_ADMIN_GROUP_NAME
+     */
+    private static final String DEFAULT_GROUP_ADMIN_GROUP_NAME = "GroupAdmin";
+ 
+    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());
+
+			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 {
+			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;
+				}
+			}
+		} catch (RepositoryException 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());
+
+			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;
+	}
+
+	/* (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
+			}
+
+			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());
+
+			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;
+	}
+
+
+	// ---------- SCR Integration ----------------------------------------------
+
+    /**
+     * Called by SCR to activate the component.
+     *
+     * @throws InvalidKeyException
+     * @throws NoSuchAlgorithmException
+     * @throws IllegalStateException
+     * @throws UnsupportedEncodingException
+     */
+    protected void activate(ComponentContext componentContext)
+            throws InvalidKeyException, NoSuchAlgorithmException,
+            IllegalStateException, UnsupportedEncodingException {
+
+        Dictionary<?, ?> properties = componentContext.getProperties();
+
+        this.userAdminGroupName = OsgiUtil.toString(properties.get(PAR_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);
+        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;
+    }
+}

-- 
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-1517 - fixing Maven 3 warnings and switching to released version of animal sniffer

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

commit f59c6d06c11d91bfaa33fad16bf64e44dce85613
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Tue May 4 21:17:40 2010 +0000

    SLING-1517 - fixing Maven 3 warnings and switching to released version of animal sniffer
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@941046 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 262b189..cf9333c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,7 +61,7 @@
                 <configuration>
                     <instructions>
 						<Export-Package>
-                            org.apache.sling.jackrabbit.usermanager;version=${pom.version},
+                            org.apache.sling.jackrabbit.usermanager;version=${project.version},
 						</Export-Package>
                         <Private-Package>
                             org.apache.sling.jackrabbit.usermanager.impl.*

-- 
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: updating pom files pre-release

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

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

    updating pom files pre-release
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1030554 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index b5b0875..eba3f29 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>9</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 
@@ -61,7 +61,7 @@
                 <configuration>
                     <instructions>
 						<Export-Package>
-                            org.apache.sling.jackrabbit.usermanager;version=2.0.6,
+                            org.apache.sling.jackrabbit.usermanager;version=2.1.0,
 						</Export-Package>
                         <Private-Package>
                             org.apache.sling.jackrabbit.usermanager.impl.*

-- 
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: SLING-1698 - setting explicit export version

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

commit 4cff8f976a4e010f1b019e240a9b1d2d3d348eea
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Sep 1 15:23:53 2010 +0000

    SLING-1698 - setting explicit export version
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@991571 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index b05aed4..d582ae8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,7 +61,7 @@
                 <configuration>
                     <instructions>
 						<Export-Package>
-                            org.apache.sling.jackrabbit.usermanager;version=${project.version},
+                            org.apache.sling.jackrabbit.usermanager;version=2.0.6,
 						</Export-Package>
                         <Private-Package>
                             org.apache.sling.jackrabbit.usermanager.impl.*

-- 
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: SLING-1639 Disabling user self-registration is not working

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

commit cececbff6b251b643c609334449633bf3f1a4548
Author: Eric Norman <en...@apache.org>
AuthorDate: Wed Aug 11 00:56:53 2010 +0000

    SLING-1639 Disabling user self-registration is not working
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@984276 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 c5f102d..3daa6f6 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
@@ -148,7 +148,9 @@ public class CreateUserServlet extends AbstractUserPostServlet {
         super.activate(componentContext);
         Dictionary<?, ?> props = componentContext.getProperties();
         Object propValue = props.get(PROP_SELF_REGISTRATION_ENABLED);
-        if (propValue instanceof String) {
+        if (propValue instanceof Boolean) {
+        	selfRegistrationEnabled = (Boolean)propValue;
+        } else if (propValue instanceof String) {
             selfRegistrationEnabled = Boolean.parseBoolean((String) propValue);
         } else {
             selfRegistrationEnabled = DEFAULT_SELF_REGISTRATION_ENABLED;

-- 
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: SLING-1193 - updating jackrabbit-usermanager module

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

commit 396718f9ba5e0bb95874f5d564d8ac14b9c47a12
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Jul 29 02:34:47 2010 +0000

    SLING-1193 - updating jackrabbit-usermanager module
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@980292 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                               | 2 +-
 .../jackrabbit/usermanager/impl/resource/AuthorizableResource.java    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 8b64961..86f2168 100644
--- a/pom.xml
+++ b/pom.xml
@@ -80,7 +80,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
-            <version>2.0.8</version>
+            <version>2.0.9-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResource.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResource.java
index 56b4930..b7e2790 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResource.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResource.java
@@ -23,7 +23,7 @@ import javax.jcr.RepositoryException;
 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.sling.adapter.SlingAdaptable;
+import org.apache.sling.api.resource.AbstractResource;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceMetadata;
 import org.apache.sling.api.resource.ResourceResolver;
@@ -32,7 +32,7 @@ import org.apache.sling.api.resource.ValueMap;
 /**
  * Resource implementation for Authorizable
  */
-public class AuthorizableResource extends SlingAdaptable implements Resource {
+public class AuthorizableResource extends AbstractResource implements Resource {
     private Authorizable authorizable = null;
 
     private ResourceResolver resourceResolver = null;

-- 
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: SLING-1377 use the actual searchType to find principals and remove old comment

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

commit 115a97296f1b1e559e3bd121e2d742af5e558289
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Tue Feb 16 10:59:31 2010 +0000

    SLING-1377 use the actual searchType to find principals and remove old comment
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@910468 13f79535-47bb-0310-9956-ffa450edef68
---
 .../usermanager/impl/resource/AuthorizableResourceProvider.java    | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

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 e1d2df4..a9d7a66 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
@@ -169,15 +169,10 @@ public class AuthorizableResourceProvider implements ResourceProvider {
             }
             if (searchType != -1) {
                 PrincipalIterator principals = null;
-
-                // TODO: this actually does not work correctly since the
-                // jackrabbit findPrincipals API
-                // currently does an exact match of the search filter so it
-                // won't match a wildcard
                 Session session = resourceResolver.adaptTo(Session.class);
                 if (session != null) {
                     PrincipalManager principalManager = AccessControlUtil.getPrincipalManager(session);
-                    principals = principalManager.getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
+                    principals = principalManager.getPrincipals(searchType);
                 }
 
                 if (principals != null) {

-- 
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: SLING-1378 Provide useful toString implementation

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

commit be4db51f71181e237e0d9605724315b3acc916d8
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Tue Feb 16 10:44:34 2010 +0000

    SLING-1378 Provide useful toString implementation
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@910459 13f79535-47bb-0310-9956-ffa450edef68
---
 .../usermanager/impl/resource/AuthorizableValueMap.java        | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableValueMap.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableValueMap.java
index c6996c0..c7ee049 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableValueMap.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableValueMap.java
@@ -184,6 +184,16 @@ public class AuthorizableValueMap implements ValueMap {
         }
     }
 
+    /**
+     * Reads the authorizable map completely and returns the string
+     * representation of the cached properties.
+     */
+    @Override
+    public String toString() {
+        readFully();
+        return cache.toString();
+    }
+
     // ---------- Unsupported Modification methods
 
     public Object remove(Object arg0) {

-- 
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: SLING-1642 User self-registration should be disabled by default

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

commit 5b0e71bf7f27c0fec2965444ac070f098d73ee5c
Author: Eric Norman <en...@apache.org>
AuthorDate: Thu Aug 12 05:42:49 2010 +0000

    SLING-1642 User self-registration should be disabled by default
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@984646 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 3daa6f6..a72ea5a 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
@@ -100,7 +100,7 @@ public class CreateUserServlet extends AbstractUserPostServlet {
      */
     private static final String PROP_SELF_REGISTRATION_ENABLED = "self.registration.enabled";
 
-    private static final Boolean DEFAULT_SELF_REGISTRATION_ENABLED = Boolean.TRUE;
+    private static final Boolean DEFAULT_SELF_REGISTRATION_ENABLED = Boolean.FALSE;
 
     private Boolean selfRegistrationEnabled = DEFAULT_SELF_REGISTRATION_ENABLED;
 

-- 
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: Use 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.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 5257882cd5d67624d4ea52cdf653788ecf10ba31
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon May 17 13:42:29 2010 +0000

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

diff --git a/pom.xml b/pom.xml
index cf9333c..8b64961 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>8</version>
+        <version>9</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-scm] copy for tag org.apache.sling.jcr.jackrabbit.usermanager-2.1.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.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

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

    [maven-scm] copy for tag org.apache.sling.jcr.jackrabbit.usermanager-2.1.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.jackrabbit.usermanager-2.1.0@1030573 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] 08/24: added missing license headers

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

commit cb2b1ff475a0359ce99a413e84bce2cb3f19de60
Author: Eric Norman <en...@apache.org>
AuthorDate: Fri Mar 19 19:56:10 2010 +0000

    added missing license headers
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@925398 13f79535-47bb-0310-9956-ffa450edef68
---
 .../usermanager/AuthorizablePrivilegesInfo.java          | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

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 5ccb119..39a0af3 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/AuthorizablePrivilegesInfo.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/AuthorizablePrivilegesInfo.java
@@ -1,3 +1,19 @@
+/*
+ * 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 javax.jcr.Session;

-- 
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: using released version of servlet modules

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

commit 3dab521935a408a538658020a91fc5163fe5efa2
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Fri Oct 15 00:18:13 2010 +0000

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

diff --git a/pom.xml b/pom.xml
index f638c87..b5b0875 100644
--- a/pom.xml
+++ b/pom.xml
@@ -90,7 +90,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.servlets.post</artifactId>
-            <version>2.0.5-SNAPSHOT</version>
+            <version>2.1.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.jackrabbit</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] 04/24: SLING-1377 Use PrincipalManager.getPrincipals method to list groups and 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.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit ae11ef6f909d01dd566de6e08b5afccb663b394b
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Tue Feb 16 10:47:39 2010 +0000

    SLING-1377 Use PrincipalManager.getPrincipals method to list groups and users
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@910463 13f79535-47bb-0310-9956-ffa450edef68
---
 .../usermanager/impl/resource/AuthorizableResourceProvider.java      | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

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 f9aef30..e1d2df4 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
@@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Resource Provider implementation for jackrabbit UserManager resources.
- * 
+ *
  * @scr.component immediate="true" label="%authorizable.resourceprovider.name"
  *                description="authorizable.resourceprovider.description"
  * @scr.property name="service.description"
@@ -177,8 +177,7 @@ public class AuthorizableResourceProvider implements ResourceProvider {
                 Session session = resourceResolver.adaptTo(Session.class);
                 if (session != null) {
                     PrincipalManager principalManager = AccessControlUtil.getPrincipalManager(session);
-                    principals = principalManager.findPrincipals(".*",
-                        PrincipalManager.SEARCH_TYPE_NOT_GROUP);
+                    principals = principalManager.getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
                 }
 
                 if (principals != null) {

-- 
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-1212 - upgrading to Jackrabbit 2. Also includes re-revert of SLING-1363 and implementation of SLING-1330. Thanks to Felix for getting this started.

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

commit 46c01fc30ceba44292bbe513c8c4e3651fe896c8
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Feb 18 15:08:43 2010 +0000

    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.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@911430 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 5b547c5..89411b9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,7 +87,7 @@
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
             <artifactId>jackrabbit-api</artifactId>
-            <version>1.6.0</version>
+            <version>2.0.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</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] 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.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit cba8357d2be8e19e08d74443019c827b48932281
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sat Feb 13 20:07:19 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@909885 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 54b4528..5b547c5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.jcr.jackrabbit.usermanager</artifactId>
     <packaging>bundle</packaging>
-    <version>2.0.4</version>
+    <version>2.0.5-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.0.4
+            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.0.4
+            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.0.4
+            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] 23/24: [maven-release-plugin] prepare release org.apache.sling.jcr.jackrabbit.usermanager-2.1.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.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 4847ba458df481c6442e1a65637c97010720bf75
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Nov 3 17:56:51 2010 +0000

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

diff --git a/pom.xml b/pom.xml
index eba3f29..e99dfe8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.jcr.jackrabbit.usermanager</artifactId>
     <packaging>bundle</packaging>
-    <version>2.0.5-SNAPSHOT</version>
+    <version>2.1.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.1.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.1.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.1.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] 12/24: SLING-1577 - using full property path instead of simple property name in creation of RequestProperty object

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

commit 0a4869d31a49dec4268c8bfdf625c270b5c808e2
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Mon Jun 28 19:43:11 2010 +0000

    SLING-1577 - using full property path instead of simple property name in creation of RequestProperty object
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@958690 13f79535-47bb-0310-9956-ffa450edef68
---
 .../impl/post/AbstractAuthorizablePostServlet.java    | 19 +++++++++++--------
 .../usermanager/impl/post/CreateGroupServlet.java     |  6 +++---
 .../usermanager/impl/post/CreateUserServlet.java      |  6 +++---
 .../usermanager/impl/post/UpdateGroupServlet.java     |  6 +++++-
 .../usermanager/impl/post/UpdateUserServlet.java      |  6 +++++-
 5 files changed, 27 insertions(+), 16 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 ba6b288..fccf282 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
@@ -287,7 +287,8 @@ public abstract class AbstractAuthorizablePostServlet extends
      * @throws ServletException if an internal error occurs
      */
     protected Map<String, RequestProperty> collectContent(
-            SlingHttpServletRequest request, HtmlResponse response) {
+            SlingHttpServletRequest request, HtmlResponse response,
+            String authorizablePath) {
 
         boolean requireItemPrefix = requireItemPathPrefix(request);
 
@@ -321,6 +322,8 @@ public abstract class AbstractAuthorizablePostServlet extends
                 // be used.
                 continue; // skip it.
             }
+            
+            propPath = authorizablePath + "/" + propPath;
 
             // @TypeHint example
             // <input type="text" name="./age" />
@@ -421,23 +424,23 @@ public abstract class AbstractAuthorizablePostServlet extends
      * <code>props</code>.
      * 
      * @param props The map of already seen request properties.
-     * @param paramName The absolute path of the property including the
+     * @param paramPath The absolute path of the property including the
      *            <code>suffix</code> to be looked up.
      * @param suffix The (optional) suffix to remove from the
      *            <code>paramName</code> before looking it up.
      * @return The {@link RequestProperty} for the <code>paramName</code>.
      */
     private RequestProperty getOrCreateRequestProperty(
-            Map<String, RequestProperty> props, String paramName, String suffix) {
-        if (suffix != null && paramName.endsWith(suffix)) {
-            paramName = paramName.substring(0, paramName.length()
+            Map<String, RequestProperty> props, String paramPath, String suffix) {
+        if (suffix != null && paramPath.endsWith(suffix)) {
+            paramPath = paramPath.substring(0, paramPath.length()
                 - suffix.length());
         }
 
-        RequestProperty prop = props.get(paramName);
+        RequestProperty prop = props.get(paramPath);
         if (prop == null) {
-            prop = new RequestProperty(paramName);
-            props.put(paramName, prop);
+            prop = new RequestProperty(paramPath);
+            props.put(paramPath, prop);
         }
 
         return prop;
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 cc87d05..5a63b07 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
@@ -114,9 +114,6 @@ public class CreateGroupServlet extends AbstractGroupPostServlet {
                     "A principal already exists with the requested name: "
                         + principalName);
             } else {
-                Map<String, RequestProperty> reqProperties = collectContent(
-                    request, response);
-
                 Group group = userManager.createGroup(new Principal() {
                     public String getName() {
                         return principalName;
@@ -125,6 +122,9 @@ public class CreateGroupServlet extends AbstractGroupPostServlet {
 
                 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,
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 f591e5b..f983d15 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
@@ -219,13 +219,13 @@ public class CreateUserServlet extends AbstractUserPostServlet {
                     "A principal already exists with the requested name: "
                         + principalName);
             } else {
-                Map<String, RequestProperty> reqProperties = collectContent(
-                    request, response);
-
                 User user = userManager.createUser(principalName,
                     digestPassword(pwd));
                 String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX
                     + user.getID();
+                
+                Map<String, RequestProperty> reqProperties = collectContent(
+                    request, response, userPath);
 
                 response.setPath(userPath);
                 response.setLocation(externalizePath(request, userPath));
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 42a7971..c4ed8f2 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
@@ -28,6 +28,7 @@ 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.impl.helper.RequestProperty;
+import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
 import org.apache.sling.servlets.post.Modification;
 
 /**
@@ -105,9 +106,12 @@ public class UpdateGroupServlet extends AbstractGroupPostServlet {
         if (session == null) {
             throw new RepositoryException("JCR Session not found");
         }
+        
+        String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
+            + authorizable.getID();
 
         Map<String, RequestProperty> reqProperties = collectContent(request,
-            htmlResponse);
+            htmlResponse, groupPath);
         try {
             // cleanup any old content (@Delete parameters)
             processDeletes(authorizable, reqProperties, changes);
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 3d60769..a65dfbd 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
@@ -28,6 +28,7 @@ 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.impl.helper.RequestProperty;
+import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
 import org.apache.sling.servlets.post.Modification;
 
 /**
@@ -106,9 +107,12 @@ public class UpdateUserServlet extends AbstractUserPostServlet {
         if (session == null) {
             throw new RepositoryException("JCR Session not found");
         }
+        
+        String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
+            + authorizable.getID();
 
         Map<String, RequestProperty> reqProperties = collectContent(request,
-            htmlResponse);
+            htmlResponse, userPath);
         try {
             // cleanup any old content (@Delete parameters)
             processDeletes(authorizable, reqProperties, changes);

-- 
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: SLING-1557 - adding members and declaredMembers properties for groups and memberOf and declaredMemberOf properties for users and groups

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

commit 659035542232a50509c11140804c585c5f640432
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Sat Jun 19 02:11:16 2010 +0000

    SLING-1557 - adding members and declaredMembers properties for groups and memberOf and declaredMemberOf properties for users and groups
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@956174 13f79535-47bb-0310-9956-ffa450edef68
---
 .../impl/resource/AuthorizableValueMap.java        | 55 +++++++++++++++++++++-
 1 file changed, 54 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableValueMap.java b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableValueMap.java
index c7ee049..1a31ca3 100644
--- a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableValueMap.java
+++ b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableValueMap.java
@@ -33,6 +33,7 @@ import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
 
 import org.apache.jackrabbit.api.security.user.Authorizable;
+import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.sling.api.resource.ValueMap;
 import org.apache.sling.jcr.resource.JcrResourceUtil;
 import org.slf4j.Logger;
@@ -42,6 +43,15 @@ import org.slf4j.LoggerFactory;
  * ValueMap implementation for Authorizable Resources
  */
 public class AuthorizableValueMap implements ValueMap {
+
+    private static final String DECLARED_MEMBERS_KEY = "declaredMembers";
+
+    private static final String MEMBERS_KEY = "members";
+
+    private static final String DECLARED_MEMBER_OF_KEY = "declaredMemberOf";
+
+    private static final String MEMBER_OF_KEY = "memberOf";
+
     private Logger logger = LoggerFactory.getLogger(AuthorizableValueMap.class);
 
     private boolean fullyRead;
@@ -126,7 +136,6 @@ public class AuthorizableValueMap implements ValueMap {
     }
 
     protected Object read(String key) {
-
         // if the item has been completely read, we need not check
         // again, as we certainly will not find the key
         if (fullyRead) {
@@ -134,6 +143,19 @@ public class AuthorizableValueMap implements ValueMap {
         }
 
         try {
+            if (key.equals(MEMBERS_KEY) && authorizable.isGroup()) {
+                return getMembers((Group) authorizable, true);
+            }
+            if (key.equals(DECLARED_MEMBERS_KEY) && authorizable.isGroup()) {
+                return getMembers((Group) authorizable, false);
+            }
+            if (key.equals(MEMBER_OF_KEY)) {
+                return getMemberships(authorizable, true);
+            }
+            if (key.equals(DECLARED_MEMBER_OF_KEY)) {
+                return getMemberships(authorizable, false);
+            }
+
             if (authorizable.hasProperty(key)) {
                 final Value[] property = authorizable.getProperty(key);
                 final Object value = valuesToJavaObject(property);
@@ -167,6 +189,13 @@ public class AuthorizableValueMap implements ValueMap {
     protected void readFully() {
         if (!fullyRead) {
             try {
+                if (authorizable.isGroup()) {
+                    cache.put(MEMBERS_KEY, getMembers((Group) authorizable, true));
+                    cache.put(DECLARED_MEMBERS_KEY, getMembers((Group) authorizable, false));
+                }
+                cache.put(MEMBER_OF_KEY, getMemberships(authorizable, true));
+                cache.put(DECLARED_MEMBER_OF_KEY, getMemberships(authorizable, false));
+
                 Iterator pi = authorizable.getPropertyNames();
                 while (pi.hasNext()) {
                     String key = (String) pi.next();
@@ -319,4 +348,28 @@ public class AuthorizableValueMap implements ValueMap {
         return type;
     }
 
+    private String[] getMembers(Group group, boolean includeAll) throws RepositoryException {
+        List<String> results = new ArrayList<String>();
+        for (Iterator<Authorizable> it = includeAll ? group.getMembers() : group.getDeclaredMembers();
+                it.hasNext();) {
+            Authorizable auth = it.next();
+            if (auth.isGroup()) {
+                results.add(AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX + auth.getID());
+            } else {
+                results.add(AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX + auth.getID());
+            }
+        }
+        return results.toArray(new String[results.size()]);
+    }
+
+    private String[] getMemberships(Authorizable authorizable, boolean includeAll) throws RepositoryException {
+        List<String> results = new ArrayList<String>();
+        for (Iterator<Group> it = includeAll ? authorizable.memberOf() : authorizable.declaredMemberOf();
+                it.hasNext();) {
+            Group group = it.next();
+            results.add(AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX + group.getID());
+        }
+        return results.toArray(new String[results.size()]);
+    }
+
 }
\ 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] 18/24: SLING-1676 Let UserManager POST servlets return JSON

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

commit aadce9e6c6d45a23ef72dca93ec55f6fe2ffe95d
Author: Eric Norman <en...@apache.org>
AuthorDate: Tue Aug 24 04:36:06 2010 +0000

    SLING-1676 Let UserManager POST servlets return JSON
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@988381 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 20 ++++++++++++++++--
 .../impl/post/AbstractAuthorizablePostServlet.java | 24 +++++++++++++++++++---
 2 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6768e00..b05aed4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -68,7 +68,8 @@
                         </Private-Package>
                         <Embed-Dependency>
                             org.apache.sling.servlets.post;inline="org/apache/sling/servlets/post/impl/helper/RequestProperty*
-                                |org/apache/sling/servlets/post/impl/helper/DateParser*"
+                                |org/apache/sling/servlets/post/impl/helper/DateParser*
+                                |org/apache/sling/servlets/post/impl/helper/JSONResponse*"
                         </Embed-Dependency>
                     </instructions>
                 </configuration>
@@ -89,7 +90,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.servlets.post</artifactId>
-            <version>2.0.4-incubator</version>
+            <version>2.0.5-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
@@ -109,5 +110,20 @@
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.compendium</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.jcr.resource</artifactId>
+            <version>2.0.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.osgi</artifactId>
+            <version>2.0.6</version>
+            <scope>provided</scope>
+        </dependency>
+		<dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
     </dependencies>
 </project>
\ No newline at end of file
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 315f636..9b7e0e7 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
@@ -44,11 +44,12 @@ 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.servlets.post.impl.helper.DateParser;
-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.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;
@@ -103,7 +104,7 @@ public abstract class AbstractAuthorizablePostServlet extends
             SlingHttpServletResponse httpResponse) throws ServletException,
             IOException {
         // prepare the response
-        HtmlResponse htmlResponse = new HtmlResponse();
+        HtmlResponse htmlResponse = createHtmlResponse(request);
         htmlResponse.setReferer(request.getHeader("referer"));
 
         // calculate the paths
@@ -191,6 +192,23 @@ public abstract class AbstractAuthorizablePostServlet extends
     }
 
     /**
+     * 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

-- 
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: updating all modules to parent 10-SNAPSHOT in anticipation of emma additions to 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.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 8610f04a754fbca65c5f7495e563161a84810bfb
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Oct 13 20:54:21 2010 +0000

    updating all modules to parent 10-SNAPSHOT in anticipation of emma additions to parent
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1022288 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index d582ae8..f638c87 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>.