What problem does it solve?
This Skill helps you implement correct WordPress authorization so users can only access the roles, capabilities, and meta-capabilities your Sage/Acorn project intends.
Core Features & Use Cases
- Capability hierarchy mapping: Understand and apply Roles → Capabilities → Meta Capabilities, including dynamic mapping via
map_meta_cap.
- Custom capability management for CPTs: Register and grant CPT-derived capabilities (e.g.,
edit_projects, publish_projects) to roles.
- Runtime authorization checks: Use
current_user_can() for admin, REST, and route-level permission callbacks.
- Acorn/Laravel-style integration patterns: Bridge WordPress authorization to Gates/Policies and JWT middleware guards while ensuring the WP current user context is set correctly.
- Verification guidance: Test with WP-CLI role/cap lists and runtime audits to confirm checks behave as expected.
Quick Start
Instruct your AI assistant to map your custom post type permissions (via map_meta_cap), grant the resulting capabilities to the correct roles once on activation, and wire a REST permission callback and/or Acorn Gate that uses current_user_can() with the right capability name for the protected action.