class RelationshipFieldAccess implements AccessInterface (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.
 

Defines a class to check access to related and relationship routes.

Deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. There is no replacement. JSON:API's access checkers are not part of its public API.

Constants

ROUTE_REQUIREMENT_KEY

The route requirement key for this access check.

Properties

protected EntityAccessChecker $entityAccessChecker

The JSON:API entity access checker.

Methods

__construct(EntityAccessChecker $entity_access_checker)

RelationshipFieldAccess constructor.

access(Request $request, Route $route, AccountInterface $account)

Checks access to the relationship field on the given route.

Details

__construct(EntityAccessChecker $entity_access_checker)

RelationshipFieldAccess constructor.

Parameters

EntityAccessChecker $entity_access_checker

The JSON:API entity access checker.

AccessResultInterface access(Request $request, Route $route, AccountInterface $account)

Checks access to the relationship field on the given route.

Parameters

Request $request

The incoming HTTP request object.

Route $route

The route to check against.

AccountInterface $account

The currently logged in account.

Return Value

AccessResultInterface

The access result.