jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r698201 - in /jackrabbit/branches/1.4/jackrabbit-core: ./ src/main/java/org/apache/jackrabbit/core/SessionImpl.java src/test/java/org/apache/jackrabbit/core/integration/SessionImplTest.java
Date Tue, 23 Sep 2008 15:02:41 GMT
Author: jukka
Date: Tue Sep 23 08:02:41 2008
New Revision: 698201

URL: http://svn.apache.org/viewvc?rev=698201&view=rev
Log:
JCR-1731: Session.checkPermission("/", "add_node") throws PathNotFoundException instead of
AccessControlException

Fixed in the 1.4 branch.

Merged the test case from trunk.

Added:
    jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/SessionImplTest.java
      - copied unchanged from r698200, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/SessionImplTest.java
Modified:
    jackrabbit/branches/1.4/jackrabbit-core/   (props changed)
    jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java

Propchange: jackrabbit/branches/1.4/jackrabbit-core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 23 08:02:41 2008
@@ -1 +1 @@
-/jackrabbit/trunk/jackrabbit-core:653417,654078,654514,655917,656240,656655,656664,658583,668147,672125,678788,679389,680135,681031,681287,682409,686688,691181,691550,694164
+/jackrabbit/trunk/jackrabbit-core:653417,654078,654514,655917,656240,656655,656664,658583,668147,672125,678788,679389,680135,681031,681287,682409,686688,691181,691550,694164,698200

Modified: jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java?rev=698201&r1=698200&r2=698201&view=diff
==============================================================================
--- jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
(original)
+++ jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
Tue Sep 23 08:02:41 2008
@@ -707,12 +707,12 @@
          */
         if (set.contains(ADD_NODE_ACTION)) {
             try {
-                parentPath = targetPath.getAncestor(1);
-                parentId = hierMgr.resolveNodePath(parentPath);
-                if (parentId == null) {
+                if (targetPath.denotesRoot()) {
                     // parent does not exist (i.e. / was specified), throw exception
                     throw new AccessControlException(ADD_NODE_ACTION);
                 }
+                parentPath = targetPath.getAncestor(1);
+                parentId = hierMgr.resolveNodePath(parentPath);
                 accessMgr.checkPermission(parentId, AccessManager.WRITE);
             } catch (AccessDeniedException re) {
                 // otherwise the RepositoryException catch clause will



Mime
View raw message