EditEntityFieldAccessCheck::access

public EditEntityFieldAccessCheck::access(EntityInterface $entity, $field_name, $langcode, AccountInterface $account)

Checks Quick Edit access to the field.

@todo Use the $account argument: https://www.drupal.org/node/2266809.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity containing the field.

string $field_name: The field name.

string $langcode: The langcode.

\Drupal\Core\Session\AccountInterface $account: The currently logged in account.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

File

core/modules/quickedit/src/Access/EditEntityFieldAccessCheck.php, line 32

Class

EditEntityFieldAccessCheck
Access check for editing entity fields.

Namespace

Drupal\quickedit\Access

Code

public function access(EntityInterface $entity, $field_name, $langcode, AccountInterface $account) {
  if (!$this->validateRequestAttributes($entity, $field_name, $langcode)) {
    return AccessResult::forbidden();
  }

  return $this->accessEditEntityField($entity, $field_name);
}
doc_Drupal
2016-10-29 09:03:32
Comments
Leave a Comment

Please login to continue.