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 theResourceAccessGate
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.
-
-
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:
canRead
in interfaceResourceAccessGate
-
canCreate
public ResourceAccessGate.GateResult canCreate(java.lang.String absPathName, ResourceResolver resourceResolver)
- Specified by:
canCreate
in interfaceResourceAccessGate
-
canOrderChildren
public ResourceAccessGate.GateResult canOrderChildren(Resource resource)
- Specified by:
canOrderChildren
in interfaceResourceAccessGate
-
canUpdate
public ResourceAccessGate.GateResult canUpdate(Resource resource)
- Specified by:
canUpdate
in interfaceResourceAccessGate
-
canDelete
public ResourceAccessGate.GateResult canDelete(Resource resource)
- Specified by:
canDelete
in interfaceResourceAccessGate
-
canExecute
public ResourceAccessGate.GateResult canExecute(Resource resource)
- Specified by:
canExecute
in interfaceResourceAccessGate
-
canReadValue
public ResourceAccessGate.GateResult canReadValue(Resource resource, java.lang.String valueName)
- Specified by:
canReadValue
in interfaceResourceAccessGate
-
canCreateValue
public ResourceAccessGate.GateResult canCreateValue(Resource resource, java.lang.String valueName)
- Specified by:
canCreateValue
in interfaceResourceAccessGate
-
canUpdateValue
public ResourceAccessGate.GateResult canUpdateValue(Resource resource, java.lang.String valueName)
- Specified by:
canUpdateValue
in interfaceResourceAccessGate
-
canDeleteValue
public ResourceAccessGate.GateResult canDeleteValue(Resource resource, java.lang.String valueName)
- Specified by:
canDeleteValue
in interfaceResourceAccessGate
-
transformQuery
public java.lang.String transformQuery(java.lang.String query, java.lang.String language, ResourceResolver resourceResolver) throws 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 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:
hasReadRestrictions
in interfaceResourceAccessGate
-
hasCreateRestrictions
public boolean hasCreateRestrictions(ResourceResolver resourceResolver)
- Specified by:
hasCreateRestrictions
in interfaceResourceAccessGate
-
hasOrderChildrenRestrictions
public boolean hasOrderChildrenRestrictions(ResourceResolver resourceResolver)
- Specified by:
hasOrderChildrenRestrictions
in interfaceResourceAccessGate
-
hasUpdateRestrictions
public boolean hasUpdateRestrictions(ResourceResolver resourceResolver)
- Specified by:
hasUpdateRestrictions
in interfaceResourceAccessGate
-
hasDeleteRestrictions
public boolean hasDeleteRestrictions(ResourceResolver resourceResolver)
- Specified by:
hasDeleteRestrictions
in interfaceResourceAccessGate
-
hasExecuteRestrictions
public boolean hasExecuteRestrictions(ResourceResolver resourceResolver)
- Specified by:
hasExecuteRestrictions
in interfaceResourceAccessGate
-
canReadAllValues
public boolean canReadAllValues(Resource resource)
- Specified by:
canReadAllValues
in interfaceResourceAccessGate
-
canCreateAllValues
public boolean canCreateAllValues(Resource resource)
- Specified by:
canCreateAllValues
in interfaceResourceAccessGate
-
canUpdateAllValues
public boolean canUpdateAllValues(Resource resource)
- Specified by:
canUpdateAllValues
in interfaceResourceAccessGate
-
canDeleteAllValues
public boolean canDeleteAllValues(Resource resource)
- Specified by:
canDeleteAllValues
in interfaceResourceAccessGate
-
-