Package org.apache.sling.resourceaccesssecurity

# Class AllowingResourceAccessGate

java.lang.Object
org.apache.sling.resourceaccesssecurity.AllowingResourceAccessGate

All Implemented Interfaces:
  `ResourceAccessGate`

public abstract class AllowingResourceAccessGate extends Object implements 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
Constructor
Description
`AllowingResourceAccessGate()`

## Method Summary

Modifier and Type
Method
Description
`ResourceAccessGate.GateResult`
`canCreate(String absPathName, org.apache.sling.api.resource.ResourceResolver resourceResolver)`
`boolean`
`canCreateAllValues(org.apache.sling.api.resource.Resource resource)`
`ResourceAccessGate.GateResult`
`canCreateValue(org.apache.sling.api.resource.Resource resource, String valueName)`
`ResourceAccessGate.GateResult`
`canDelete(org.apache.sling.api.resource.Resource resource)`
`boolean`
`canDeleteAllValues(org.apache.sling.api.resource.Resource resource)`
`ResourceAccessGate.GateResult`
`canDeleteValue(org.apache.sling.api.resource.Resource resource, String valueName)`
`ResourceAccessGate.GateResult`
`canExecute(org.apache.sling.api.resource.Resource resource)`
`ResourceAccessGate.GateResult`
`canOrderChildren(org.apache.sling.api.resource.Resource resource)`
`ResourceAccessGate.GateResult`
`canRead(org.apache.sling.api.resource.Resource resource)`
`boolean`
`canReadAllValues(org.apache.sling.api.resource.Resource resource)`
`ResourceAccessGate.GateResult`
`canReadValue(org.apache.sling.api.resource.Resource resource, String valueName)`
`ResourceAccessGate.GateResult`
`canUpdate(org.apache.sling.api.resource.Resource resource)`
`boolean`
`canUpdateAllValues(org.apache.sling.api.resource.Resource resource)`
`ResourceAccessGate.GateResult`
`canUpdateValue(org.apache.sling.api.resource.Resource resource, String valueName)`
`boolean`
`hasCreateRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)`
`boolean`
`hasDeleteRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)`
`boolean`
`hasExecuteRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)`
`boolean`
`hasOrderChildrenRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)`
`boolean`
`hasReadRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)`
`boolean`
`hasUpdateRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)`
`String`
`transformQuery(String query, String language, org.apache.sling.api.resource.ResourceResolver resourceResolver)`
Allows to transform the query based on the current user's credentials.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### AllowingResourceAccessGate

public AllowingResourceAccessGate()

## Method Details

### canRead

public ResourceAccessGate.GateResult canRead(org.apache.sling.api.resource.Resource resource)

Specified by:
  `canRead` in interface `ResourceAccessGate`

### canCreate

public ResourceAccessGate.GateResult canCreate(String absPathName, org.apache.sling.api.resource.ResourceResolver resourceResolver)

Specified by:
  `canCreate` in interface `ResourceAccessGate`

### canOrderChildren

public ResourceAccessGate.GateResult canOrderChildren(org.apache.sling.api.resource.Resource resource)

Specified by:
  `canOrderChildren` in interface `ResourceAccessGate`

### canUpdate

public ResourceAccessGate.GateResult canUpdate(org.apache.sling.api.resource.Resource resource)

Specified by:
  `canUpdate` in interface `ResourceAccessGate`

### canDelete

public ResourceAccessGate.GateResult canDelete(org.apache.sling.api.resource.Resource resource)

Specified by:
  `canDelete` in interface `ResourceAccessGate`

### canExecute

public ResourceAccessGate.GateResult canExecute(org.apache.sling.api.resource.Resource resource)

Specified by:
  `canExecute` in interface `ResourceAccessGate`

### canReadValue

public ResourceAccessGate.GateResult canReadValue(org.apache.sling.api.resource.Resource resource, String valueName)

Specified by:
  `canReadValue` in interface `ResourceAccessGate`

### canCreateValue

public ResourceAccessGate.GateResult canCreateValue(org.apache.sling.api.resource.Resource resource, String valueName)

Specified by:
  `canCreateValue` in interface `ResourceAccessGate`

### canUpdateValue

public ResourceAccessGate.GateResult canUpdateValue(org.apache.sling.api.resource.Resource resource, String valueName)

Specified by:
  `canUpdateValue` in interface `ResourceAccessGate`

### canDeleteValue

public ResourceAccessGate.GateResult canDeleteValue(org.apache.sling.api.resource.Resource resource, String valueName)

Specified by:
  `canDeleteValue` in interface `ResourceAccessGate`

### 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: `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 interface `ResourceAccessGate`
Parameters:
  `query` - the query
  `language` - the language in which the query is expressed
  `resourceResolver` - 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:
  `hasReadRestrictions` in interface `ResourceAccessGate`

### hasCreateRestrictions

public boolean hasCreateRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)

Specified by:
  `hasCreateRestrictions` in interface `ResourceAccessGate`

### hasOrderChildrenRestrictions

public boolean hasOrderChildrenRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)

Specified by:
  `hasOrderChildrenRestrictions` in interface `ResourceAccessGate`

### hasUpdateRestrictions

public boolean hasUpdateRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)

Specified by:
  `hasUpdateRestrictions` in interface `ResourceAccessGate`

### hasDeleteRestrictions

public boolean hasDeleteRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)

Specified by:
  `hasDeleteRestrictions` in interface `ResourceAccessGate`

### hasExecuteRestrictions

public boolean hasExecuteRestrictions(org.apache.sling.api.resource.ResourceResolver resourceResolver)

Specified by:
  `hasExecuteRestrictions` in interface `ResourceAccessGate`

### canReadAllValues

public boolean canReadAllValues(org.apache.sling.api.resource.Resource resource)

Specified by:
  `canReadAllValues` in interface `ResourceAccessGate`

### canCreateAllValues

public boolean canCreateAllValues(org.apache.sling.api.resource.Resource resource)

Specified by:
  `canCreateAllValues` in interface `ResourceAccessGate`

### canUpdateAllValues

public boolean canUpdateAllValues(org.apache.sling.api.resource.Resource resource)

Specified by:
  `canUpdateAllValues` in interface `ResourceAccessGate`

### canDeleteAllValues

public boolean canDeleteAllValues(org.apache.sling.api.resource.Resource resource)

Specified by:
  `canDeleteAllValues` in interface `ResourceAccessGate`