You are here

public function MailingListManager::hasSessionAccess in Mailing List 8

Checks if the current user has session access to a given subscription.

Parameters

\Drupal\mailing_list\SubscriptionInterface\SubscriptionInterface $subscription: The subscription.

Return value

bool TRUE if the current user has session access granted to the subscription.

Overrides MailingListManagerInterface::hasSessionAccess

1 call to MailingListManager::hasSessionAccess()
MailingListManager::revokeSessionAccess in src/MailingListManager.php
Revoke any session access to a subscription to the current user.

File

src/MailingListManager.php, line 92

Class

MailingListManager
Mailing list manager implementation.

Namespace

Drupal\mailing_list

Code

public function hasSessionAccess(SubscriptionInterface $subscription) {
  return $this->sessionManager
    ->isStarted() && ($grants = $this->userPrivateTempstore
    ->get('mailing_list')
    ->get('grants')) && isset($grants[$subscription
    ->uuid()]);
}