diff --git a/core/lib/Drupal/Core/Entity/EntityAccessController.php b/core/lib/Drupal/Core/Entity/EntityAccessController.php index 429cd4b..7f46933 100644 --- a/core/lib/Drupal/Core/Entity/EntityAccessController.php +++ b/core/lib/Drupal/Core/Entity/EntityAccessController.php @@ -194,7 +194,7 @@ public function resetCache() { /** * {@inheritdoc} */ - public function createAccess($type, AccountInterface $account = NULL, $context = array()) { + public function createAccess($entity_bundle = '', AccountInterface $account = NULL, $context = array()) { $account = $this->prepareUser($account); $context += array( 'langcode' => Language::LANGCODE_DEFAULT, diff --git a/core/lib/Drupal/Core/Entity/EntityAccessControllerInterface.php b/core/lib/Drupal/Core/Entity/EntityAccessControllerInterface.php index 9054f98..3fff27a 100644 --- a/core/lib/Drupal/Core/Entity/EntityAccessControllerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityAccessControllerInterface.php @@ -38,15 +38,15 @@ public function access(EntityInterface $entity, $operation, $langcode = Language /** * Checks access to create an entity. * - * @param string $type - * The node type to check access for. + * @param string $entity_bundle + * (optional) The bundle to check access for. Defaults to an empty string. * @param \Drupal\Core\Session\AccountInterface $account * (optional) The user session for which to check access, or NULL to check * access for the current user. Defaults to NULL. * @param array $context * An array of key-value pairs to pass additional context when needed. */ - public function createAccess($type, AccountInterface $account = NULL, $context = array()); + public function createAccess($entity_bundle = '', AccountInterface $account = NULL, $context = array()); /** * Clears all cached access checks. diff --git a/core/modules/node/lib/Drupal/node/NodeAccessController.php b/core/modules/node/lib/Drupal/node/NodeAccessController.php index 2c33189..e456029 100644 --- a/core/modules/node/lib/Drupal/node/NodeAccessController.php +++ b/core/modules/node/lib/Drupal/node/NodeAccessController.php @@ -32,7 +32,7 @@ public function access(EntityInterface $entity, $operation, $langcode = Language } /** - * @param string $type + * @param string $entity_bundle * The node type to check access for. * @param \Drupal\Core\Session\AccountInterface $account * (optional) The user session for which to check access, or NULL to check @@ -40,7 +40,7 @@ public function access(EntityInterface $entity, $operation, $langcode = Language * @param array $context * An array of key-value pairs to pass additional context when needed. */ - public function createAccess($type, AccountInterface $account = NULL, $context = array()) { + public function createAccess($entity_bundle, AccountInterface $account = NULL, $context = array()) { $account = $this->prepareUser($account); if (user_access('bypass node access', $account)) { @@ -53,8 +53,8 @@ public function createAccess($type, AccountInterface $account = NULL, $context = $access = module_invoke_all('node_create_access', $account, $context); $configured_types = node_permissions_get_configured_types(); - if (isset($configured_types[$type])) { - if (user_access('create ' . $type . ' content', $account)) { + if (isset($configured_types[$entity_bundle])) { + if (user_access('create ' . $entity_bundle . ' content', $account)) { $access[] = NODE_ACCESS_ALLOW; } }