Skip to content

Drupal 10 Module that provides a Context Condition that checks the user's IP address, and a Context Reaction that denies access to nodes and media.

License

Notifications You must be signed in to change notification settings

Born-Digital-US/ip_range_access

Repository files navigation

IP Range Access

Introduction

Drupal 10 Module that provides a Context Condition that checks the user's IP address, and a Context Reaction that denies access to nodes and media. If the Reaction executes, it returns a 403 Access Denied response to the user (or optionally redirect them to a proxy to authenticate before accessing the resource).

This module's primary use case was to provide IP access control to Islandora content, but it can be used without Islandora.

Requirements

Installation

  1. Clone this repo into your Islandora's drupal/web/modules/contrib directory.
  2. Enable the module either under the "Admin > Extend" menu or by running drush en -y ip_range_access.

Configuration

The Condition and Reaction are independent of each other (Context FTW!) but if your intent is to block a user from accessing content based on their IP address, do the following:

  1. Create a Context and choose the "User's IP address" Condition.
  2. Enter the ranges or individual IP addresses from where access is prohibited.
  3. (Optional) Add additional Conditions ("Node has parent", "Node has term", "User role", etc.). You probably want to add the "User's Role" condition to make sure that administrators aren't blocked from accessing content.
  4. Choose the "Deny access to node or media" Reaction and check the box.
    • (Optional) Add the URL of a proxy, such as Ezproxy, to the reaction's configuration, e.g., https://proxy.example.com/login?url=.

Sponsors

This work was made possible via the generous contribution of Boston College.

Current maintainer

Contributing

Bug reports, improvements, feature requests, and PRs welcome. Before you open a pull request, please open an issue.

License

GPLv2

About

Drupal 10 Module that provides a Context Condition that checks the user's IP address, and a Context Reaction that denies access to nodes and media.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages