workspace_access_test.module

Same filename in other branches
  1. 8.9.x core/modules/workspaces/tests/modules/workspace_access_test/workspace_access_test.module
  2. 10 core/modules/workspaces/tests/modules/workspace_access_test/workspace_access_test.module
  3. 11.x core/modules/workspaces/tests/modules/workspace_access_test/workspace_access_test.module

Provides supporting code for testing access for workspaces.

File

core/modules/workspaces/tests/modules/workspace_access_test/workspace_access_test.module

View source
<?php


/**
 * @file
 * Provides supporting code for testing access for workspaces.
 */
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;

/**
 * Implements hook_ENTITY_TYPE_access() for the 'workspace' entity type.
 */
function workspace_access_test_workspace_access(EntityInterface $entity, $operation, AccountInterface $account) {
    return \Drupal::state()->get("workspace_access_test.result.{$operation}", AccessResult::neutral());
}

Functions

Title Deprecated Summary
workspace_access_test_workspace_access Implements hook_ENTITY_TYPE_access() for the 'workspace' entity type.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.