Check your version

This tutorial covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Last updated June 7, 2017

Create a permissions hook to secure access to pages within Drupal.

Objectives and Prerequisites

You will need the following knowledge and skills. If you need a review, check out the Resources section at the bottom of this page.

  1. How to use permissions hooks.
  2. Understand security issues within Drupal.

Tasks

Create a permissions hook, with a permission of 'add movie review' to restrict access to the custom movie import page.

For the role of 'contributor' in your demo site, add the permission 'add movie review', also ensuring access to create and edit their own Movie Review nodes.

Make a list of 10 issues which can affect security within Drupal.

Summary

  • Maintaining a secure site within Drupal is essential, and a wide range of factors need to be taken into account to ensure this.
  • Any custom code must take into consideration security issues by validating input and output.

Resources

Creative Commons License

Drupal Training Resources by Damian Robinson are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Based on a work at http://www.damianrobinson.co.uk.