AccessibleInterface.php

Contains \Drupal\Core\TypedData\AccessibleInterface.

Namespace

Drupal\Core\TypedData

File

drupal/core/lib/Drupal/Core/TypedData/AccessibleInterface.php
View source
<?php

/**
 * @file
 * Contains \Drupal\Core\TypedData\AccessibleInterface.
 */
namespace Drupal\Core\TypedData;

use Drupal\Core\Session\AccountInterface;

/**
 * Interface for checking access.
 */
interface AccessibleInterface {

  /**
   * Checks data value access.
   *
   * @param string $operation
   *   (optional) The operation to be performed. Supported values are:
   *   - view
   *   - create
   *   - update
   *   - delete
   *   Defaults to 'view'.
   * @param Drupal\Core\Session\AccountInterface $account
   *   (optional) The user for which to check access, or NULL to check access
   *   for the current user. Defaults to NULL.
   *
   * @return bool
   *   TRUE if the given user has access for the given operation, FALSE
   *   otherwise.
   *
   * @todo Don't depend on module level code.
   */
  public function access($operation = 'view', AccountInterface $account = NULL);

}

Interfaces

Namesort descending Description
AccessibleInterface Interface for checking access.