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