You are here

public function PagesRestrictionSessionService::setBypass in Pages Restriction Access 8

Set Bypass.

File

src/Service/PagesRestrictionSessionService.php, line 29

Class

PagesRestrictionSessionService
Pages Restriction Session Service.

Namespace

Drupal\pages_restriction\Service

Code

public function setBypass($path) {

  // Get current bypass values.
  $pages_restriction_bypass = $this->session
    ->get('pages_restriction_bypass');

  // Set next URL on bypass session.
  $pages_restriction_bypass[] = $path;

  // Update Bypass Session.
  $this->session
    ->set('pages_restriction_bypass', $pages_restriction_bypass);

  // Return Bypass Session.
  return $pages_restriction_bypass;
}