Search in sources :

Example 1 with AccessSecurityException

use of org.apache.sling.api.security.AccessSecurityException in project sling by apache.

the class AuthenticatedResourceProvider method transformQuery.

/**
     * applies resource access security if configured
     */
private String transformQuery(final String query, final String language) {
    String returnValue = query;
    if (this.useRAS) {
        final ResourceAccessSecurity resourceAccessSecurity = tracker.getProviderResourceAccessSecurity();
        if (resourceAccessSecurity != null) {
            try {
                returnValue = resourceAccessSecurity.transformQuery(returnValue, language, this.resolveContext.getResourceResolver());
            } catch (AccessSecurityException e) {
                logger.error("AccessSecurityException occurred while trying to transform the query {} (language {}).", new Object[] { query, language }, e);
            }
        }
    }
    final ResourceAccessSecurity resourceAccessSecurity = tracker.getApplicationResourceAccessSecurity();
    if (resourceAccessSecurity != null) {
        try {
            returnValue = resourceAccessSecurity.transformQuery(returnValue, language, this.resolveContext.getResourceResolver());
        } catch (AccessSecurityException e) {
            logger.error("AccessSecurityException occurred while trying to transform the query {} (language {}).", new Object[] { query, language }, e);
        }
    }
    return returnValue;
}
Also used : ResourceAccessSecurity(org.apache.sling.api.security.ResourceAccessSecurity) AccessSecurityException(org.apache.sling.api.security.AccessSecurityException)

Aggregations

AccessSecurityException (org.apache.sling.api.security.AccessSecurityException)1 ResourceAccessSecurity (org.apache.sling.api.security.ResourceAccessSecurity)1