class WorkspaceViewCheck in Workspace 8
Hierarchy
- class \Drupal\workspace\Access\WorkspaceViewCheck implements AccessInterface
Expanded class hierarchy of WorkspaceViewCheck
1 string reference to 'WorkspaceViewCheck'
1 service uses WorkspaceViewCheck
File
- src/Access/ WorkspaceViewCheck.php, line 11 
Namespace
Drupal\workspace\AccessView source
class WorkspaceViewCheck implements AccessInterface {
  /**
   * Checks that the user should be able to view the specified workspace.
   *
   * "View" in practice implies "is allowed to make active".
   *
   * @param WorkspaceInterface $workspace
   *   The workspace to view.
   * @param AccountInterface $account
   *   The user account to check.
   *
   * @return AccessResultInterface
   *   The access result.
   */
  public function access(WorkspaceInterface $workspace, AccountInterface $account) {
    return AccessResult::allowedIf($workspace
      ->access('view', $account))
      ->addCacheableDependency($workspace);
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| WorkspaceViewCheck:: | public | function | Checks that the user should be able to view the specified workspace. | 
