Class AllowingResourceAccessGate
- java.lang.Object
-
- org.apache.sling.resourceaccesssecurity.AllowingResourceAccessGate
-
- All Implemented Interfaces:
ResourceAccessGate
public abstract class AllowingResourceAccessGate extends java.lang.Object implements ResourceAccessGate
This abstract implementation of theResourceAccessGatecan 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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.sling.resourceaccesssecurity.ResourceAccessGate
ResourceAccessGate.GateResult, ResourceAccessGate.Operation
-
-
Field Summary
-
Fields inherited from interface org.apache.sling.resourceaccesssecurity.ResourceAccessGate
APPLICATION_CONTEXT, CONTEXT, FINALOPERATIONS, OPERATIONS, PATH, PROVIDER_CONTEXT, SERVICE_NAME
-
-
Constructor Summary
Constructors Constructor Description AllowingResourceAccessGate()
-
Method Summary
-
-
-
Method Detail
-
canRead
public ResourceAccessGate.GateResult canRead(Resource resource)
- Specified by:
canReadin interfaceResourceAccessGate
-
canCreate
public ResourceAccessGate.GateResult canCreate(java.lang.String absPathName, ResourceResolver resourceResolver)
- Specified by:
canCreatein interfaceResourceAccessGate
-
canOrderChildren
public ResourceAccessGate.GateResult canOrderChildren(Resource resource)
- Specified by:
canOrderChildrenin interfaceResourceAccessGate
-
canUpdate
public ResourceAccessGate.GateResult canUpdate(Resource resource)
- Specified by:
canUpdatein interfaceResourceAccessGate
-
canDelete
public ResourceAccessGate.GateResult canDelete(Resource resource)
- Specified by:
canDeletein interfaceResourceAccessGate
-
canExecute
public ResourceAccessGate.GateResult canExecute(Resource resource)
- Specified by:
canExecutein interfaceResourceAccessGate
-
canReadValue
public ResourceAccessGate.GateResult canReadValue(Resource resource, java.lang.String valueName)
- Specified by:
canReadValuein interfaceResourceAccessGate
-
canCreateValue
public ResourceAccessGate.GateResult canCreateValue(Resource resource, java.lang.String valueName)
- Specified by:
canCreateValuein interfaceResourceAccessGate
-
canUpdateValue
public ResourceAccessGate.GateResult canUpdateValue(Resource resource, java.lang.String valueName)
- Specified by:
canUpdateValuein interfaceResourceAccessGate
-
canDeleteValue
public ResourceAccessGate.GateResult canDeleteValue(Resource resource, java.lang.String valueName)
- Specified by:
canDeleteValuein interfaceResourceAccessGate
-
transformQuery
public java.lang.String transformQuery(java.lang.String query, java.lang.String language, ResourceResolver resourceResolver) throws AccessSecurityExceptionDescription copied from interface:ResourceAccessGateAllows 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:
transformQueryin interfaceResourceAccessGate- 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:
AccessSecurityException
-
hasReadRestrictions
public boolean hasReadRestrictions(ResourceResolver resourceResolver)
- Specified by:
hasReadRestrictionsin interfaceResourceAccessGate
-
hasCreateRestrictions
public boolean hasCreateRestrictions(ResourceResolver resourceResolver)
- Specified by:
hasCreateRestrictionsin interfaceResourceAccessGate
-
hasOrderChildrenRestrictions
public boolean hasOrderChildrenRestrictions(ResourceResolver resourceResolver)
- Specified by:
hasOrderChildrenRestrictionsin interfaceResourceAccessGate
-
hasUpdateRestrictions
public boolean hasUpdateRestrictions(ResourceResolver resourceResolver)
- Specified by:
hasUpdateRestrictionsin interfaceResourceAccessGate
-
hasDeleteRestrictions
public boolean hasDeleteRestrictions(ResourceResolver resourceResolver)
- Specified by:
hasDeleteRestrictionsin interfaceResourceAccessGate
-
hasExecuteRestrictions
public boolean hasExecuteRestrictions(ResourceResolver resourceResolver)
- Specified by:
hasExecuteRestrictionsin interfaceResourceAccessGate
-
canReadAllValues
public boolean canReadAllValues(Resource resource)
- Specified by:
canReadAllValuesin interfaceResourceAccessGate
-
canCreateAllValues
public boolean canCreateAllValues(Resource resource)
- Specified by:
canCreateAllValuesin interfaceResourceAccessGate
-
canUpdateAllValues
public boolean canUpdateAllValues(Resource resource)
- Specified by:
canUpdateAllValuesin interfaceResourceAccessGate
-
canDeleteAllValues
public boolean canDeleteAllValues(Resource resource)
- Specified by:
canDeleteAllValuesin interfaceResourceAccessGate
-
-