public function TestAccess::hasFieldViewAccessForEveryEntity in Field Permissions 8
Same name and namespace in other branches
- 8.2 tests/modules/field_permissions_test/src/Plugin/FieldPermissionType/TestAccess.php \Drupal\field_permissions_test\Plugin\FieldPermissionType\TestAccess::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.
Overrides Base::hasFieldViewAccessForEveryEntity
File
- tests/
modules/ field_permissions_test/ src/ Plugin/ FieldPermissionType/ TestAccess.php, line 35
Class
- TestAccess
- A test field permission type plugin.
Namespace
Drupal\field_permissions_test\Plugin\FieldPermissionTypeCode
public function hasFieldViewAccessForEveryEntity(AccountInterface $account) {
return $account
->hasPermission('foo access');
}