drupal-access-security

Implement Drupal access control with permissions, route access, CSRF protection, and XSS prevention.

1|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/proofoftom/drupal-skills --skill drupal-access-security
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drupal-access-security
Source: https://github.com/proofoftom/drupal-skills/tree/main/skills/drupal-access-security
Command: npx skills add https://github.com/proofoftom/drupal-skills --skill drupal-access-security

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures that only authorized users can access specific routes, content, or perform actions within a Drupal site, preventing unauthorized access and protecting sensitive data.

Core Features & Use Cases

  • Permission Management: Define granular permissions for users and roles.
  • Route Access Control: Secure specific pages and API endpoints using permissions, roles, or custom logic.
  • Entity Access: Implement access control for custom and core entity types.
  • CSRF Protection: Safeguard against Cross-Site Request Forgery for state-changing actions.
  • XSS Prevention: Mitigate Cross-Site Scripting vulnerabilities in output.
  • Use Case: You need to ensure that only users with the 'edit own project notes' permission can edit their own notes, and that an 'archive' action link is protected against CSRF attacks.

Quick Start

Implement Drupal access control and security for your module by defining permissions and securing routes.

Frequently Asked Questions about drupal-access-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I restrict access to Drupal routes using custom permissions?

Restrict access to Drupal routes by defining granular permissions and applying them as route access requirements. This ensures only authorized users with specific roles can access secured pages and API endpoints.

How does Drupal entity access control handle user-specific content permissions?

Drupal entity access control uses custom access handlers to implement logic for restricting content. This allows you to enforce rules like only letting users edit their own notes based on specific permissions.

What is the best way to protect Drupal forms against CSRF attacks?

Protect Drupal forms against CSRF attacks by implementing token validation for state-changing actions. This safeguards form submissions from Cross-Site Request Forgery, ensuring actions like archive links are verified.

How do I prevent XSS vulnerabilities in Drupal module output?

Prevent XSS vulnerabilities in Drupal by sanitizing output to mitigate Cross-Site Scripting. This process ensures that rendered content strips malicious scripts, protecting the application from injection attacks.

Why do I need AccessResult checks for Drupal route security?

AccessResult checks are needed for Drupal route security because they evaluate permissions and return cacheable dependencies. This ensures access decisions are cached properly without exposing sensitive data to unauthorized users.

Can I define custom Drupal permissions for specific module actions?

You can define custom Drupal permissions for specific module actions using a permissions file. This grants granular control over user roles, ensuring only authorized users execute specific actions like editing project notes.