You are here

class FieldCollectionItemHostOperationCheck in Field collection 8

Same name and namespace in other branches
  1. 8.3 src/Access/FieldCollectionItemHostOperationCheck.php \Drupal\field_collection\Access\FieldCollectionItemHostOperationCheck

Determines access to operations on the field collection item's host.

Hierarchy

Expanded class hierarchy of FieldCollectionItemHostOperationCheck

1 string reference to 'FieldCollectionItemHostOperationCheck'
field_collection.services.yml in ./field_collection.services.yml
field_collection.services.yml
1 service uses FieldCollectionItemHostOperationCheck
access_check.field_collection_item.host_operation in ./field_collection.services.yml
Drupal\field_collection\Access\FieldCollectionItemHostOperationCheck

File

src/Access/FieldCollectionItemHostOperationCheck.php, line 14

Namespace

Drupal\field_collection\Access
View source
class FieldCollectionItemHostOperationCheck implements AccessInterface {

  /**
   * Checks access to the operation on the field collection item's host.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The currently logged in account.
   *
   * TODO: Document params
   *
   * @return string
   *   A \Drupal\Core\Access\AccessInterface constant value.
   */
  public function access(Route $route, AccountInterface $account, $field_collection_item_revision = NULL, FieldCollectionItem $field_collection_item = NULL) {
    $operation = $route
      ->getRequirement('_access_field_collection_item_host');
    return AccessResult::allowedIf($field_collection_item && $field_collection_item
      ->getHost()
      ->access($operation, $account))
      ->cachePerPermissions();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FieldCollectionItemHostOperationCheck::access public function Checks access to the operation on the field collection item's host.