You are here

public function SessionWorkspaceNegotiator::applies in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php \Drupal\workspaces\Negotiator\SessionWorkspaceNegotiator::applies()
  2. 10 core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php \Drupal\workspaces\Negotiator\SessionWorkspaceNegotiator::applies()

Checks whether the negotiator applies to the current request or not.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The HTTP request.

Return value

bool TRUE if the negotiator applies for the current request, FALSE otherwise.

Overrides WorkspaceNegotiatorInterface::applies

1 call to SessionWorkspaceNegotiator::applies()
QueryParameterWorkspaceNegotiator::applies in core/modules/workspaces/src/Negotiator/QueryParameterWorkspaceNegotiator.php
Checks whether the negotiator applies to the current request or not.
1 method overrides SessionWorkspaceNegotiator::applies()
QueryParameterWorkspaceNegotiator::applies in core/modules/workspaces/src/Negotiator/QueryParameterWorkspaceNegotiator.php
Checks whether the negotiator applies to the current request or not.

File

core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php, line 56

Class

SessionWorkspaceNegotiator
Defines the session workspace negotiator.

Namespace

Drupal\workspaces\Negotiator

Code

public function applies(Request $request) {

  // This negotiator only applies if the current user is authenticated.
  return $this->currentUser
    ->isAuthenticated();
}