incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1130845 - /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
Date Thu, 02 Jun 2011 22:05:55 GMT
Author: justin
Date: Thu Jun  2 22:05:55 2011
New Revision: 1130845

URL: http://svn.apache.org/viewvc?rev=1130845&view=rev
Log:
SLING-2096 - checking for the workspace name in the request

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java?rev=1130845&r1=1130844&r2=1130845&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
Thu Jun  2 22:05:55 2011
@@ -594,6 +594,22 @@ public class JcrResourceResolver
                         return null;
                     }
                 }
+            } else {
+                // check for workspace info in request
+                workspaceName = (request == null ? null :
+                    (String)request.getAttribute(ResourceResolver.REQUEST_ATTR_WORKSPACE_INFO));
+                if ( workspaceName != null && !workspaceName.equals(getSession().getWorkspace().getName()))
{
+                    LOGGER.debug("Delegating resolving to resolver for workspace {}", workspaceName);
+                    try {
+                        JcrResourceResolver wsResolver = getResolverForWorkspace(workspaceName);
+                        res = wsResolver.resolveInternal(mappedPath);
+                    } catch (LoginException e) {
+                        // requested a resource in a workspace I don't have access to.
+                        // we treat this as a not found resource
+                        return null;
+                    }
+
+                }
             }
         }
 



Mime
View raw message