You are here

public function WorkspaceViewCheck::access in Workspace 8

Checks that the user should be able to view the specified workspace.

"View" in practice implies "is allowed to make active".

Parameters

WorkspaceInterface $workspace: The workspace to view.

AccountInterface $account: The user account to check.

Return value

AccessResultInterface The access result.

File

src/Access/WorkspaceViewCheck.php, line 26

Class

WorkspaceViewCheck

Namespace

Drupal\workspace\Access

Code

public function access(WorkspaceInterface $workspace, AccountInterface $account) {
  return AccessResult::allowedIf($workspace
    ->access('view', $account))
    ->addCacheableDependency($workspace);
}