You are here

public function FieldPermissionTypeInterface::hasFieldAccess in Field Permissions 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/FieldPermissionTypeInterface.php \Drupal\field_permissions\Plugin\FieldPermissionTypeInterface::hasFieldAccess()

Determine if access to the field is granted for a given account.

Parameters

string $operation: The operation to check. Either 'view' or 'edit'.

\Drupal\Core\Entity\EntityInterface $entity: The entity the field is attached to.

\Drupal\Core\Session\AccountInterface $account: The user to check access for.

Return value

bool The access result.

3 methods override FieldPermissionTypeInterface::hasFieldAccess()
CustomAccess::hasFieldAccess in src/Plugin/FieldPermissionType/CustomAccess.php
Determine if access to the field is granted for a given account.
PrivateAccess::hasFieldAccess in src/Plugin/FieldPermissionType/PrivateAccess.php
Determine if access to the field is granted for a given account.
TestAccess::hasFieldAccess in tests/modules/field_permissions_test/src/Plugin/FieldPermissionType/TestAccess.php
Determine if access to the field is granted for a given account.

File

src/Plugin/FieldPermissionTypeInterface.php, line 80

Class

FieldPermissionTypeInterface
A field permission type plugin interface.

Namespace

Drupal\field_permissions\Plugin

Code

public function hasFieldAccess($operation, EntityInterface $entity, AccountInterface $account);