Class AllowingResourceAccessGate
java.lang.Object
org.apache.sling.resourceaccesssecurity.AllowingResourceAccessGate
- All Implemented Interfaces:
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.-
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 -
Method Summary
Modifier and TypeMethodDescriptioncanCreate(String absPathName, ResourceResolver resourceResolver) booleancanCreateAllValues(Resource resource) canCreateValue(Resource resource, String valueName) booleancanDeleteAllValues(Resource resource) canDeleteValue(Resource resource, String valueName) canExecute(Resource resource) canOrderChildren(Resource resource) booleancanReadAllValues(Resource resource) canReadValue(Resource resource, String valueName) booleancanUpdateAllValues(Resource resource) canUpdateValue(Resource resource, String valueName) booleanhasCreateRestrictions(ResourceResolver resourceResolver) booleanhasDeleteRestrictions(ResourceResolver resourceResolver) booleanhasExecuteRestrictions(ResourceResolver resourceResolver) booleanhasOrderChildrenRestrictions(ResourceResolver resourceResolver) booleanhasReadRestrictions(ResourceResolver resourceResolver) booleanhasUpdateRestrictions(ResourceResolver resourceResolver) transformQuery(String query, String language, ResourceResolver resourceResolver) Allows to transform the query based on the current user's credentials.
-
Constructor Details
-
AllowingResourceAccessGate
public AllowingResourceAccessGate()
-
-
Method Details
-
canRead
- Specified by:
canReadin interfaceResourceAccessGate
-
canCreate
public ResourceAccessGate.GateResult canCreate(String absPathName, ResourceResolver resourceResolver) - Specified by:
canCreatein interfaceResourceAccessGate
-
canOrderChildren
- Specified by:
canOrderChildrenin interfaceResourceAccessGate
-
canUpdate
- Specified by:
canUpdatein interfaceResourceAccessGate
-
canDelete
- Specified by:
canDeletein interfaceResourceAccessGate
-
canExecute
- Specified by:
canExecutein interfaceResourceAccessGate
-
canReadValue
- Specified by:
canReadValuein interfaceResourceAccessGate
-
canCreateValue
- Specified by:
canCreateValuein interfaceResourceAccessGate
-
canUpdateValue
- Specified by:
canUpdateValuein interfaceResourceAccessGate
-
canDeleteValue
- Specified by:
canDeleteValuein interfaceResourceAccessGate
-
transformQuery
public String transformQuery(String query, String language, ResourceResolver resourceResolver) throws AccessSecurityException Description 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
- Specified by:
hasReadRestrictionsin interfaceResourceAccessGate
-
hasCreateRestrictions
- Specified by:
hasCreateRestrictionsin interfaceResourceAccessGate
-
hasOrderChildrenRestrictions
- Specified by:
hasOrderChildrenRestrictionsin interfaceResourceAccessGate
-
hasUpdateRestrictions
- Specified by:
hasUpdateRestrictionsin interfaceResourceAccessGate
-
hasDeleteRestrictions
- Specified by:
hasDeleteRestrictionsin interfaceResourceAccessGate
-
hasExecuteRestrictions
- Specified by:
hasExecuteRestrictionsin interfaceResourceAccessGate
-
canReadAllValues
- Specified by:
canReadAllValuesin interfaceResourceAccessGate
-
canCreateAllValues
- Specified by:
canCreateAllValuesin interfaceResourceAccessGate
-
canUpdateAllValues
- Specified by:
canUpdateAllValuesin interfaceResourceAccessGate
-
canDeleteAllValues
- Specified by:
canDeleteAllValuesin interfaceResourceAccessGate
-