incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1558770 - /sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ProviderHandler.java
Date Thu, 16 Jan 2014 12:26:12 GMT
Author: cziegeler
Date: Thu Jan 16 12:26:12 2014
New Revision: 1558770

URL: http://svn.apache.org/r1558770
Log:
SLING-2698 : resource access ecurity service for resource providers

Modified:
    sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ProviderHandler.java

Modified: sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ProviderHandler.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ProviderHandler.java?rev=1558770&r1=1558769&r2=1558770&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ProviderHandler.java
(original)
+++ sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ProviderHandler.java
Thu Jan 16 12:26:12 2014
@@ -117,13 +117,17 @@ public abstract class ProviderHandler im
     protected Resource getReadableResource ( final ResourceResolverContext ctx, Resource
resource ) {
         final ResourceAccessSecurityTracker tracker = ctx.getResourceAccessSecurityTracker();
 
-        Resource returnValue = resource;
+        Resource returnValue = null;
 
-        if (useResourceAccessSecurity && tracker != null && returnValue !=
null) {
-            final ResourceAccessSecurity resourceAccessSecurity = tracker.getProviderResourceAccessSecurity();
-            if (resourceAccessSecurity != null) {
-                returnValue = resourceAccessSecurity.getReadableResource(resource);
+        if (useResourceAccessSecurity && returnValue != null) {
+            if ( tracker != null ) {
+                final ResourceAccessSecurity resourceAccessSecurity = tracker.getProviderResourceAccessSecurity();
+                if (resourceAccessSecurity != null) {
+                    returnValue = resourceAccessSecurity.getReadableResource(resource);
+                }
             }
+        } else {
+            returnValue = resource;
         }
 
         if ( returnValue != null && tracker != null ) {



Mime
View raw message