public function MailingListManager::revokeSessionAccess in Mailing List 8
Revoke any session access to a subscription to the current user.
Parameters
\Drupal\mailing_list\SubscriptionInterface\SubscriptionInterface $subscription: The subscription.
Overrides MailingListManagerInterface::revokeSessionAccess
File
- src/
MailingListManager.php, line 80
Class
- MailingListManager
- Mailing list manager implementation.
Namespace
Drupal\mailing_listCode
public function revokeSessionAccess(SubscriptionInterface $subscription) {
if ($this
->hasSessionAccess($subscription)) {
$collection = $this->userPrivateTempstore
->get('mailing_list');
$grants = $collection
->get('grants');
unset($grants[$subscription
->uuid()]);
$collection
->set('grants', $grants);
}
}