Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

pages_restriction

1,057 sites Security covered
View on drupal.org

Module to restrict access from anonymous and regular users to configured pre-defined pages.
Into the /admin/config/pages_restriction/restrict_access configuration page it's possible to setup custom rules to provide access restriction for anonymous and regular users.
Was setup a custom session id to each form rule so we check if the page that user must be redirected depending on user's registering sequence.

Example: homepage|about-us will block access to about-us page and redirect users to homepage.

To possible use the current session id to enable access for multiple pages we need to setup into the form submission the function _pages_restriction_set_next_page_path($next_page_path) where $next_page_path variable should be the current_path();

Example: homepage|about-us|contact|thank-you-page

If you try to access directly the Thank you page without fill all the forms flows and without setup the set_next_page_path() into the previous pages form submit, ("About Us"), ("Contact"), you should be redirected back to the Homepage.

Author: Vitor Grillo

Drupal 8

There is a field to configure your paths using key|value syntax.

You can also configure the roles you want to bypass as the image below:

Bypass

To ignore a path at runtime you can add a bypass with the setBypass function:

\Drupal::service('pages_restriction.session_service')->setBypass($path);

Or if you prefer you can set the "pages_restriction_bypass" session manually. E.g:

$pagesRestrictionBypass[] = $path;
$this->session->set('pages_restriction_bypass', $pagesRestrictionBypass);

Credits


http://www.ciandt.com

Activity

Total releases
1
First release
Dec 2024
Latest release
1 year ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
2.0.3 Stable Dec 4, 2024