jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r518901 - /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
Date Fri, 16 Mar 2007 09:33:40 GMT
Author: angela
Date: Fri Mar 16 02:33:39 2007
New Revision: 518901

URL: http://svn.apache.org/viewvc?view=rev&rev=518901
Log:
check for permission on the SPI impl must use workspace-Id

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java?view=diff&rev=518901&r1=518900&r2=518901
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
Fri Mar 16 02:33:39 2007
@@ -506,11 +506,11 @@
      */
     public boolean isGranted(ItemState itemState, String[] actions) throws ItemNotFoundException,
RepositoryException {
         // a 'new' state can always be read, written and removed
-        // TODO: correct?
         if (itemState.getStatus() == Status.NEW) {
             return true;
         }
-        return service.isGranted(sessionInfo, itemState.getId(), actions);
+        ItemState wspState = itemState.getWorkspaceState();
+        return service.isGranted(sessionInfo, wspState.getId(), actions);
     }
 
     /**
@@ -521,7 +521,8 @@
         if (itemState.getStatus() == Status.NEW) {
             return true;
         }
-        return service.isGranted(sessionInfo, itemState.getId(), AccessManager.READ);
+        ItemState wspState = itemState.getWorkspaceState();
+        return service.isGranted(sessionInfo, wspState.getId(), AccessManager.READ);
     }
 
     /**
@@ -532,7 +533,8 @@
         if (itemState.getStatus() == Status.NEW) {
             return true;
         }
-        return service.isGranted(sessionInfo, itemState.getId(), AccessManager.REMOVE);
+        ItemState wspState = itemState.getWorkspaceState();
+        return service.isGranted(sessionInfo, wspState.getId(), AccessManager.REMOVE);
     }
 
     /**



Mime
View raw message