You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:58:10 UTC
[sling-org-apache-sling-resourceaccesssecurity] 07/13: SLING-3917 -
Add transformQuery support to the ResourceAccessSecurity Implementation
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.resourceaccesssecurity-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceaccesssecurity.git
commit 8e3ceb691f1bc7c3cec06afc847ccfd543f304a0
Author: Mike Müller <my...@apache.org>
AuthorDate: Tue Sep 9 06:49:02 2014 +0000
SLING-3917 - Add transformQuery support to the ResourceAccessSecurity Implementation
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/resourceaccesssecurity/core@1623676 13f79535-47bb-0310-9956-ffa450edef68
---
.../sling/resourceaccesssecurity/ResourceAccessGate.java | 3 ++-
.../impl/ResourceAccessSecurityImpl.java | 15 ++++++++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/sling/resourceaccesssecurity/ResourceAccessGate.java b/src/main/java/org/apache/sling/resourceaccesssecurity/ResourceAccessGate.java
index 6ee4e2b..dd7ce7a 100644
--- a/src/main/java/org/apache/sling/resourceaccesssecurity/ResourceAccessGate.java
+++ b/src/main/java/org/apache/sling/resourceaccesssecurity/ResourceAccessGate.java
@@ -187,7 +187,8 @@ public interface ResourceAccessGate {
* the language in which the query is expressed
* @param resourceResolver
* the resource resolver which resolves the query
- * @return the transformed query
+ * @return the transformed query or the original query if no tranformation
+ * took place. This method should never return <code>null</code>
* @throws AccessSecurityException
*/
public String transformQuery(String query, String language,
diff --git a/src/main/java/org/apache/sling/resourceaccesssecurity/impl/ResourceAccessSecurityImpl.java b/src/main/java/org/apache/sling/resourceaccesssecurity/impl/ResourceAccessSecurityImpl.java
index cd1f200..53adb79 100644
--- a/src/main/java/org/apache/sling/resourceaccesssecurity/impl/ResourceAccessSecurityImpl.java
+++ b/src/main/java/org/apache/sling/resourceaccesssecurity/impl/ResourceAccessSecurityImpl.java
@@ -339,7 +339,20 @@ public abstract class ResourceAccessSecurityImpl implements ResourceAccessSecuri
final String language,
final ResourceResolver resourceResolver)
throws AccessSecurityException {
- return query;
+ String returnValue = query;
+
+ for (ResourceAccessGateHandler handler : allHandlers) {
+ returnValue = handler.getResourceAccessGate().transformQuery(
+ returnValue, language, resourceResolver);
+ if (returnValue == null) {
+ throw new AccessSecurityException(
+ "Method transformQuery in ResourceAccessGate "
+ + handler.getResourceAccessGate().getClass()
+ .getName() + " returned null.");
+ }
+ }
+
+ return returnValue;
}
/**
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.