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.
Create a permissions hook to secure access to pages within Drupal.
Require a user to have a certain permission before they can access a page.
You will need the following knowledge and skills. If you need a review, check out the Additional resources section at the bottom of this page.
- How to use permissions hooks.
- Understand security issues within Drupal.
Create a permissions hook, with a permission of ‘add movie review’ to restrict access to the custom movie import page.
- 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.
Further your understanding
- Continue to the next lesson: Movie Project: Manage Configuration Changes.
- API Documentation: hook_permission (api.drupal.org)
- Video: Tips for Writing Secure Code