jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r787942 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user: AuthorizableImpl.java GroupImpl.java
Date Wed, 24 Jun 2009 08:38:31 GMT
Author: angela
Date: Wed Jun 24 08:38:30 2009
New Revision: 787942

URL: http://svn.apache.org/viewvc?rev=787942&view=rev
Log:
JCR-2135: UserManagement: make membership a weakreferences

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/AuthorizableImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/AuthorizableImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/AuthorizableImpl.java?rev=787942&r1=787941&r2=787942&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/AuthorizableImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/AuthorizableImpl.java
Wed Jun 24 08:38:30 2009
@@ -333,7 +333,7 @@
             return false;
         }
 
-        Value toRemove = getSession().getValueFactory().createValue(group.getNode());
+        Value toRemove = getSession().getValueFactory().createValue(group.getNode(), true);
         PropertyImpl property = node.getProperty(P_GROUPS);
         List valList = new ArrayList(Arrays.asList(property.getValues()));
         if (valList.remove(toRemove)) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java?rev=787942&r1=787941&r2=787942&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java
Wed Jun 24 08:38:30 2009
@@ -168,7 +168,7 @@
      * @throws RepositoryException If an error occurs while collecting the members.
      */
     private Collection getMembers(boolean includeIndirect) throws RepositoryException {
-        PropertyIterator itr = getNode().getWeakReferences();
+        PropertyIterator itr = getNode().getWeakReferences(getSession().getJCRName(P_GROUPS));
         Collection members = new HashSet((int) itr.getSize());
         while (itr.hasNext()) {
             NodeImpl n = (NodeImpl) itr.nextProperty().getParent();
@@ -182,6 +182,10 @@
             } else if (n.isNodeType(NT_REP_USER)) {
                 User user = userManager.createUser(n);
                 members.add(user);
+            } else {
+                // weak-ref property 'rep:groups' that doesn't reside under an
+                // authorizable node -> doesn't represent a member of this group.
+                log.debug("Undefined reference to group '" + getID() + "' -> Not included
in member set.");
             }
         }
         return members;



Mime
View raw message