You are here

class WorkspaceViewCheck in Workspace 8

Hierarchy

Expanded class hierarchy of WorkspaceViewCheck

1 string reference to 'WorkspaceViewCheck'
workspace.services.yml in ./workspace.services.yml
workspace.services.yml
1 service uses WorkspaceViewCheck
access_check.workspace_view in ./workspace.services.yml
Drupal\workspace\Access\WorkspaceViewCheck

File

src/Access/WorkspaceViewCheck.php, line 11

Namespace

Drupal\workspace\Access
View 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

Namesort descending Modifiers Type Description Overrides
WorkspaceViewCheck::access public function Checks that the user should be able to view the specified workspace.