class EntityAccessDeniedHttpException extends CacheableAccessDeniedHttpException implements ResourceIdentifierInterface (View source)

internal  JSON:API maintains no PHP API. The API is the HTTP API. This class may change at any time and could break any dependencies on it.
 

Enhances the access denied exception with information about the entity.

Traits

Provides dependency injection friendly methods for serialization.

Used to associate an object like an exception to a particular resource.

Trait for \Drupal\Core\Cache\CacheableDependencyInterface.

Properties

protected string[] $cacheContexts

Cache contexts.

from  CacheableDependencyTrait
protected string[] $cacheTags

Cache tags.

from  CacheableDependencyTrait
protected int $cacheMaxAge

Cache max-age.

from  CacheableDependencyTrait
protected array $_serviceIds

An array of service IDs keyed by property name used for serialization.

from  DependencySerializationTrait
protected array $_entityStorages

An array of entity type IDs keyed by the property name of their storages.

from  DependencySerializationTrait
protected ResourceIdentifier $resourceIdentifier

A ResourceIdentifier object.

from  ResourceIdentifierTrait
protected ResourceType $resourceType

The JSON:API resource type of the identified resource object.

from  ResourceIdentifierTrait
protected array $error

The error which caused the 403.

Methods

$this
setCacheability(CacheableDependencyInterface $cacheability)

Sets cacheability; useful for value object constructors.

getCacheTags()

{@inheritdoc}

__construct(EntityInterface|null $entity, AccessResultInterface $entity_access, string $pointer, $message = 'The current user is not allowed to GET the selected resource.', string $relationship_field = NULL, Exception $previous = NULL, $code = 0)

EntityAccessDeniedHttpException constructor.

__sleep()

{@inheritdoc}

__wakeup()

{@inheritdoc}

getId()

{@inheritdoc}

getTypeName()

{@inheritdoc}

array
getError()

Returns the error.

Details

protected $this setCacheability(CacheableDependencyInterface $cacheability)

Sets cacheability; useful for value object constructors.

Parameters

CacheableDependencyInterface $cacheability

The cacheability to set.

Return Value

$this

getCacheTags()

{@inheritdoc}

getCacheContexts()

{@inheritdoc}

getCacheMaxAge()

{@inheritdoc}

__construct(EntityInterface|null $entity, AccessResultInterface $entity_access, string $pointer, $message = 'The current user is not allowed to GET the selected resource.', string $relationship_field = NULL, Exception $previous = NULL, $code = 0)

EntityAccessDeniedHttpException constructor.

Parameters

EntityInterface|null $entity

The entity, or NULL when an entity is being created.

AccessResultInterface $entity_access

The access result.

string $pointer

(optional) The pointer.

$message
string $relationship_field

(Optional) A relationship field name if access was denied because the user does not have permission to view an entity's relationship field.

Exception $previous
$code

__sleep()

{@inheritdoc}

__wakeup()

{@inheritdoc}

getId()

{@inheritdoc}

getTypeName()

{@inheritdoc}

getResourceType()

{@inheritdoc}

array getError()

Returns the error.

Return Value

array

The error.