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 TypeMethodDescriptionbooleancanCreateAllValues(org.apache.sling.api.resource.Resource resource) canCreateValue(org.apache.sling.api.resource.Resource resource, String valueName) canDelete(org.apache.sling.api.resource.Resource resource) booleancanDeleteAllValues(org.apache.sling.api.resource.Resource resource) canDeleteValue(org.apache.sling.api.resource.Resource resource, String valueName) canExecute(org.apache.sling.api.resource.Resource resource) canOrderChildren(org.apache.sling.api.resource.Resource resource) canRead(org.apache.sling.api.resource.Resource resource) booleancanReadAllValues(org.apache.sling.api.resource.Resource resource) canReadValue(org.apache.sling.api.resource.Resource resource, String valueName) canUpdate(org.apache.sling.api.resource.Resource resource) booleancanUpdateAllValues(org.apache.sling.api.resource.Resource resource) canUpdateValue(org.apache.sling.api.resource.Resource resource, String valueName) booleanhasCreateRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver) booleanhasDeleteRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver) booleanhasExecuteRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver) booleanhasOrderChildrenRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver) booleanhasReadRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver) booleanhasUpdateRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver) transformQuery(String query, String language, org.apache.sling.api.resource.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, org.apache.sling.api.resource.ResourceResolver resourceResolver) - Specified by:
canCreatein interfaceResourceAccessGate
-
canOrderChildren
public ResourceAccessGate.GateResult canOrderChildren(org.apache.sling.api.resource.Resource resource) - Specified by:
canOrderChildrenin interfaceResourceAccessGate
-
canUpdate
- Specified by:
canUpdatein interfaceResourceAccessGate
-
canDelete
- Specified by:
canDeletein interfaceResourceAccessGate
-
canExecute
- Specified by:
canExecutein interfaceResourceAccessGate
-
canReadValue
public ResourceAccessGate.GateResult canReadValue(org.apache.sling.api.resource.Resource resource, String valueName) - Specified by:
canReadValuein interfaceResourceAccessGate
-
canCreateValue
public ResourceAccessGate.GateResult canCreateValue(org.apache.sling.api.resource.Resource resource, String valueName) - Specified by:
canCreateValuein interfaceResourceAccessGate
-
canUpdateValue
public ResourceAccessGate.GateResult canUpdateValue(org.apache.sling.api.resource.Resource resource, String valueName) - Specified by:
canUpdateValuein interfaceResourceAccessGate
-
canDeleteValue
public ResourceAccessGate.GateResult canDeleteValue(org.apache.sling.api.resource.Resource resource, String valueName) - Specified by:
canDeleteValuein interfaceResourceAccessGate
-
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: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:
org.apache.sling.api.security.AccessSecurityException
-
hasReadRestrictions
public boolean hasReadRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver) - Specified by:
hasReadRestrictionsin interfaceResourceAccessGate
-
hasCreateRestrictions
public boolean hasCreateRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver) - Specified by:
hasCreateRestrictionsin interfaceResourceAccessGate
-
hasOrderChildrenRestrictions
public boolean hasOrderChildrenRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver) - Specified by:
hasOrderChildrenRestrictionsin interfaceResourceAccessGate
-
hasUpdateRestrictions
public boolean hasUpdateRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver) - Specified by:
hasUpdateRestrictionsin interfaceResourceAccessGate
-
hasDeleteRestrictions
public boolean hasDeleteRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver) - Specified by:
hasDeleteRestrictionsin interfaceResourceAccessGate
-
hasExecuteRestrictions
public boolean hasExecuteRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver) - Specified by:
hasExecuteRestrictionsin interfaceResourceAccessGate
-
canReadAllValues
public boolean canReadAllValues(org.apache.sling.api.resource.Resource resource) - Specified by:
canReadAllValuesin interfaceResourceAccessGate
-
canCreateAllValues
public boolean canCreateAllValues(org.apache.sling.api.resource.Resource resource) - Specified by:
canCreateAllValuesin interfaceResourceAccessGate
-
canUpdateAllValues
public boolean canUpdateAllValues(org.apache.sling.api.resource.Resource resource) - Specified by:
canUpdateAllValuesin interfaceResourceAccessGate
-
canDeleteAllValues
public boolean canDeleteAllValues(org.apache.sling.api.resource.Resource resource) - Specified by:
canDeleteAllValuesin interfaceResourceAccessGate
-