WorkspaceAccessTestHooks.php

Namespace

Drupal\workspace_access_test\Hook

File

core/modules/workspaces/tests/modules/workspace_access_test/src/Hook/WorkspaceAccessTestHooks.php

View source
<?php

declare (strict_types=1);
namespace Drupal\workspace_access_test\Hook;

use Drupal\Core\Access\AccessResult;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Hook\Attribute\Hook;

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

}

Classes

Title Deprecated Summary
WorkspaceAccessTestHooks Hook implementations for workspace_access_test.

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