Capabilities & roles
Control who can access WP-PFWorkflow features. Eight granular capabilities let you give different teams different levels of access.
Capability list
| Capability | Constant | What it allows |
|---|---|---|
| View workflows | pfw_view_workflows | See the workflow list and open workflows in read-only mode |
| Manage workflows | pfw_manage_workflows | Create, edit, delete, import, and export workflows |
| Run workflows | pfw_run_workflows | Trigger workflow execution manually or via REST |
| View logs | pfw_view_logs | Read execution logs, timelines, and support packages |
| View remote queue | pfw_view_remote_queue | List remote executor jobs |
| Create remote jobs | pfw_create_remote_jobs | Enqueue jobs for remote execution |
| Manage remote workers | pfw_manage_remote_workers | Create, delete, rotate, enable/disable workers |
| Approve workflows | pfw_approve_workflows | Approve or reject pending approval gates |
Capability inheritance
- Administrators get ALL capabilities automatically on plugin activation
- Users with
manage_optionsautomatically inherit ALL workflow capabilities - The cascade includes:
can_approve_workflows()=pfw_approve_workflows || pfw_manage_workflows
Assigning capabilities
Use any WordPress role editor plugin or add capabilities programmatically:
$role = get_role('editor');
$role->add_cap('pfw_view_workflows');
$role->add_cap('pfw_view_logs');
Common role configurations
| Team | Recommended capabilities |
|---|---|
| Automation builders | view_workflows, manage_workflows, run_workflows, view_logs |
| Support team | view_workflows, view_logs, approve_workflows |
| DevOps (remote exec) | view_remote_queue, create_remote_jobs, manage_remote_workers |
| Auditors | view_workflows, view_logs, view_remote_queue |