drupal-access

Define Drupal access control patterns for routes and entities.

67|13|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/edutrul/drupal-ai --skill drupal-access
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drupal-access
Source: https://github.com/edutrul/drupal-ai/tree/main
Command: npx skills add https://github.com/edutrul/drupal-ai --skill drupal-access

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Drupal access control is error-prone without standardized patterns for permissions, access callbacks, and entity-level checks.

Core Features & Use Cases

  • Provide permissions in permissions.yml, route requirements, and custom access checkers using AccessResult
  • Implement fine-grained access controls with hook_node_access and entity access checks across Drupal 11
  • Promote DI-based access checks and proper cacheability in access decisions

Quick Start

Configure a route with a DI-based access checker to enforce a specific permission.

Frequently Asked Questions about drupal-access

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

FAQPage Schema
How do I implement Drupal access control with AccessResult and custom access checkers?

Drupal access control uses AccessResult objects within custom access checkers to enforce permissions on routes. You configure route requirements and apply entity-level checks to standardize access decisions and ensure proper cacheability across your application.

What is the best way to define fine-grained permissions in Drupal 11?

Defining fine-grained Drupal permissions involves declaring rules in permissions.yml and implementing hook_node_access for entity-level checks. Using AccessResult ensures these permission decisions maintain proper cacheability metadata.

How do I configure a route with a DI-based access checker in Drupal?

Configuring a route with a DI-based access checker requires defining access requirements in your routing file and injecting services into a custom checker class. This enforces specific permissions while following Drupal 11 best practices for dependency injection.

Does Drupal 11 require dependency injection for custom access checks?

Drupal 11 best practices promote DI-based access checks to enforce permissions and route requirements. Using dependency injection ensures custom access checkers properly manage services and maintain accurate cacheability in access decisions.

Why does my Drupal entity access check return incorrect cacheability metadata?

Incorrect cacheability in Drupal entity access checks often occurs when AccessResult objects are not properly used to propagate metadata. Applying standardized patterns for hook_node_access and entity checks ensures access decisions carry correct cacheability.