org.apache.sling.resourceaccesssecurity
Class AllowingResourceAccessGate
java.lang.Object
org.apache.sling.resourceaccesssecurity.AllowingResourceAccessGate
- All Implemented Interfaces:
- ResourceAccessGate
public abstract class AllowingResourceAccessGate
- extends Object
- implements ResourceAccessGate
This abstract implementation of the ResourceAccessGate
can be
used to implement own resource access gates.
This implementation simply allows operations, restricting implementations
just need to overwrite the operations they want to restrict.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AllowingResourceAccessGate
public AllowingResourceAccessGate()
canRead
public ResourceAccessGate.GateResult canRead(org.apache.sling.api.resource.Resource resource)
- Specified by:
canRead
in interface ResourceAccessGate
canCreate
public ResourceAccessGate.GateResult canCreate(String absPathName,
org.apache.sling.api.resource.ResourceResolver resourceResolver)
- Specified by:
canCreate
in interface ResourceAccessGate
canUpdate
public ResourceAccessGate.GateResult canUpdate(org.apache.sling.api.resource.Resource resource)
- Specified by:
canUpdate
in interface ResourceAccessGate
canDelete
public ResourceAccessGate.GateResult canDelete(org.apache.sling.api.resource.Resource resource)
- Specified by:
canDelete
in interface ResourceAccessGate
canExecute
public ResourceAccessGate.GateResult canExecute(org.apache.sling.api.resource.Resource resource)
- Specified by:
canExecute
in interface ResourceAccessGate
canReadValue
public ResourceAccessGate.GateResult canReadValue(org.apache.sling.api.resource.Resource resource,
String valueName)
- Specified by:
canReadValue
in interface ResourceAccessGate
canCreateValue
public ResourceAccessGate.GateResult canCreateValue(org.apache.sling.api.resource.Resource resource,
String valueName)
- Specified by:
canCreateValue
in interface ResourceAccessGate
canUpdateValue
public ResourceAccessGate.GateResult canUpdateValue(org.apache.sling.api.resource.Resource resource,
String valueName)
- Specified by:
canUpdateValue
in interface ResourceAccessGate
canDeleteValue
public ResourceAccessGate.GateResult canDeleteValue(org.apache.sling.api.resource.Resource resource,
String valueName)
- Specified by:
canDeleteValue
in interface ResourceAccessGate
transformQuery
public String transformQuery(String query,
String language,
org.apache.sling.api.resource.ResourceResolver resourceResolver)
throws org.apache.sling.api.security.AccessSecurityException
- Description copied from interface:
ResourceAccessGate
- Allows to transform the query based on the current user's credentials.
Can be used to narrow down queries to omit results that the current user
is not allowed to see anyway, speeding up downstream access control.
Query transformations are not critical with respect to access control as
results are checked using the canRead.. methods anyway.
- Specified by:
transformQuery
in interface ResourceAccessGate
- Parameters:
query
- the querylanguage
- the language in which the query is expressedresourceResolver
- the resource resolver which resolves the query
- Returns:
- the transformed query or the original query if no tranformation
took place. This method should never return
null
- Throws:
org.apache.sling.api.security.AccessSecurityException
hasReadRestrictions
public boolean hasReadRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)
- Specified by:
hasReadRestrictions
in interface ResourceAccessGate
hasCreateRestrictions
public boolean hasCreateRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)
- Specified by:
hasCreateRestrictions
in interface ResourceAccessGate
hasUpdateRestrictions
public boolean hasUpdateRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)
- Specified by:
hasUpdateRestrictions
in interface ResourceAccessGate
hasDeleteRestrictions
public boolean hasDeleteRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)
- Specified by:
hasDeleteRestrictions
in interface ResourceAccessGate
hasExecuteRestrictions
public boolean hasExecuteRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)
- Specified by:
hasExecuteRestrictions
in interface ResourceAccessGate
canReadAllValues
public boolean canReadAllValues(org.apache.sling.api.resource.Resource resource)
- Specified by:
canReadAllValues
in interface ResourceAccessGate
canCreateAllValues
public boolean canCreateAllValues(org.apache.sling.api.resource.Resource resource)
- Specified by:
canCreateAllValues
in interface ResourceAccessGate
canUpdateAllValues
public boolean canUpdateAllValues(org.apache.sling.api.resource.Resource resource)
- Specified by:
canUpdateAllValues
in interface ResourceAccessGate
canDeleteAllValues
public boolean canDeleteAllValues(org.apache.sling.api.resource.Resource resource)
- Specified by:
canDeleteAllValues
in interface ResourceAccessGate
Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.