jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r423448 - /jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/ItemManager.java
Date Wed, 19 Jul 2006 12:50:01 GMT
Author: stefan
Date: Wed Jul 19 05:50:01 2006
New Revision: 423448

URL: http://svn.apache.org/viewvc?rev=423448&view=rev
Log:
avoid excessive privilege checking

Modified:
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/ItemManager.java

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/ItemManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/ItemManager.java?rev=423448&r1=423447&r2=423448&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/ItemManager.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/ItemManager.java
Wed Jul 19 05:50:01 2006
@@ -308,16 +308,14 @@
         // check sanity of session
         session.sanityCheck();
 
-        // check privileges
-        if (!session.getAccessManager().isGranted(id, AccessManager.READ)) {
-            // clear cache
-            evictItem(id);
-            throw new AccessDeniedException("cannot read item " + id);
-        }
-
         // check cache
         ItemImpl item = retrieveItem(id);
         if (item == null) {
+            // not yet in cache, need to create instance:
+            // check privileges
+            if (!session.getAccessManager().isGranted(id, AccessManager.READ)) {
+                throw new AccessDeniedException("cannot read item " + id);
+            }
             // create instance of item
             item = createItemInstance(id);
         }



Mime
View raw message