class FieldCollectionItemHostOperationCheck in Field collection 8
Same name and namespace in other branches
- 8.3 src/Access/FieldCollectionItemHostOperationCheck.php \Drupal\field_collection\Access\FieldCollectionItemHostOperationCheck
Determines access to operations on the field collection item's host.
Hierarchy
- class \Drupal\field_collection\Access\FieldCollectionItemHostOperationCheck implements AccessInterface
Expanded class hierarchy of FieldCollectionItemHostOperationCheck
1 string reference to 'FieldCollectionItemHostOperationCheck'
1 service uses FieldCollectionItemHostOperationCheck
File
- src/
Access/ FieldCollectionItemHostOperationCheck.php, line 14
Namespace
Drupal\field_collection\AccessView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FieldCollectionItemHostOperationCheck:: |
public | function | Checks access to the operation on the field collection item's host. |