org.apache.sling.resourceaccesssecurity.impl
Class AccessGateResourceWrapper

java.lang.Object
  extended by org.apache.sling.api.resource.ResourceWrapper
      extended by org.apache.sling.resourceaccesssecurity.impl.AccessGateResourceWrapper
All Implemented Interfaces:
org.apache.sling.api.adapter.Adaptable, org.apache.sling.api.resource.Resource

public class AccessGateResourceWrapper
extends org.apache.sling.api.resource.ResourceWrapper

The AccessGateResourceWrapper wraps a Resource and intercepts calls to adaptTo to wrap the adapted ValueMap or also a ModifiableValueMap to enforce access rules defined by implementations of ResourceAccessGate


Field Summary
 
Fields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING
 
Constructor Summary
AccessGateResourceWrapper(org.apache.sling.api.resource.Resource resource, List<ResourceAccessGate> accessGatesForReadForValues, boolean modifiable)
          Creates a new wrapper instance delegating all method calls to the given resource, but intercepts the calls with checks to the applied ResourceAccessGate instances for read and/or update values.
 
Method Summary
<AdapterType>
AdapterType
adaptTo(Class<AdapterType> type)
          Returns the value of calling adaptTo on the wrapped resource.
 
Methods inherited from class org.apache.sling.api.resource.ResourceWrapper
getChild, getChildren, getName, getParent, getPath, getResource, getResourceMetadata, getResourceResolver, getResourceSuperType, getResourceType, hasChildren, isResourceType, listChildren, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AccessGateResourceWrapper

public AccessGateResourceWrapper(org.apache.sling.api.resource.Resource resource,
                                 List<ResourceAccessGate> accessGatesForReadForValues,
                                 boolean modifiable)
Creates a new wrapper instance delegating all method calls to the given resource, but intercepts the calls with checks to the applied ResourceAccessGate instances for read and/or update values.

Parameters:
resource - resource to protect
accessGatesForReadForValues - list of access gates to ask when reading values. If the list is null or empty there are no read restrictions
modifiable - if true the resource can be updated
Method Detail

adaptTo

public <AdapterType> AdapterType adaptTo(Class<AdapterType> type)
Returns the value of calling adaptTo on the wrapped resource.

Specified by:
adaptTo in interface org.apache.sling.api.adapter.Adaptable
Overrides:
adaptTo in class org.apache.sling.api.resource.ResourceWrapper


Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.