You are here

public function Base::hasFieldViewAccessForEveryEntity in Field Permissions 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/FieldPermissionType/Base.php \Drupal\field_permissions\Plugin\FieldPermissionType\Base::hasFieldViewAccessForEveryEntity()

Determines if the given account may view the field, regardless of entity.

This should only return TRUE if

$this
  ->hasFieldAccess('view', $entity, $account);

returns TRUE for all possible $entity values.

@todo Move this to an interface: either FieldPermissionTypeInterface or a new one.

Parameters

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

Return value

bool The access result.

3 methods override Base::hasFieldViewAccessForEveryEntity()
CustomAccess::hasFieldViewAccessForEveryEntity in src/Plugin/FieldPermissionType/CustomAccess.php
Determines if the given account may view the field, regardless of entity.
PrivateAccess::hasFieldViewAccessForEveryEntity in src/Plugin/FieldPermissionType/PrivateAccess.php
Determines if the given account may view the field, regardless of entity.
TestAccess::hasFieldViewAccessForEveryEntity in tests/modules/field_permissions_test/src/Plugin/FieldPermissionType/TestAccess.php
Determines if the given account may view the field, regardless of entity.

File

src/Plugin/FieldPermissionType/Base.php, line 85

Class

Base
An abstract implementation of FieldPermissionTypeInterface.

Namespace

Drupal\field_permissions\Plugin\FieldPermissionType

Code

public function hasFieldViewAccessForEveryEntity(AccountInterface $account) {
  return FALSE;
}