Permissions & Security
Contacts enforces strict multi-tier authorization across Setup -> Contacts, programmatic services, CLI commands, and optional Headless REST endpoints.
ProcessWire RBAC Tiers (ContactsAccess)
Section titled “ProcessWire RBAC Tiers (ContactsAccess)”| Permission | Scope |
|---|---|
contacts-view |
Read-only access to Setup -> Contacts (ProcessContacts::checkAccess()), viewing Contacts, Organizations, and Interaction Notes. |
contacts-manage |
Create, edit, and export Contacts, Organizations, and Interaction Notes, plus quick-create via React relation pickers. Portal invitations also require account-admin (or superuser). |
contacts-admin |
Full administrative control: Settings (contacts-settings), Roles (contacts-roles), Tags (contacts-tags), taxonomy exports, duplicate merging (./merge/), bulk imports (./import/), GDPR subject data exports (?privacy=1), GDPR anonymization (./anonymize/), and record deletions. |
Headless Scopes & User-Bound RBAC
Section titled “Headless Scopes & User-Bound RBAC”When Headless is installed, ContactsHeadlessProvider enforces three scopes (contacts:read, contacts:write, contacts:admin):
- User-Bound Principals (JWT, PAT, Session): Must satisfy both the token scope and ProcessWire RBAC (
ContactsAccess+$entries->can()). - Unbound Machine HMAC (
scheme === 'hmac'+ guest user): Authorized strictly by HMAC scope. - Write-Only Redaction: Callers holding
contacts:writewithoutcontacts:read/contacts:admin(or blueprintview) receive redacted confirmations ({created: false, matchedBy, id}or{id, updated: true}) so pre-existing contact PII is never leaked on upsert. - Admin-Only Guards:
/api/v1/contacts/{id}/privacy-export,/api/v1/contacts/{id}/anonymize, and settinglinked_user_idrequirecontacts:admin(pluscontacts-adminfor user-bound principals). Auto-creating an organization fromcompany_namerequirescontacts-organizationscreatepermission.
Data-Isolation & Transfer Guardrails
Section titled “Data-Isolation & Transfer Guardrails”- Hidden Block Blueprints:
contacts-channel,contacts-address,contacts-membership, andcontacts-consentremain gated bycontacts-*permissions so non-Contacts editors cannot query CRM PII through generic/api/v1/entries/*endpoints. - Transfer Payload Bounds: CSV, JSON, and vCard 4.0 decoded imports enforce a 2 MiB limit (
ContactTransferService::MAX_IMPORT_BYTES = 2_097_152);ProcessContacts::executeImport()allows a 4.25 MiB JSON transport envelope so full 2 MiB payloads survive JSON escaping. - CSV Formula Neutralization (
CWE-1236):ContactTransferService::escapeCsvCell()neutralizes leading formula characters (=,+,-,@) on export, and CSV imports reverse leading apostrophe escaping cleanly. - CLI Path Containment:
contacts:export --output-filerejects..traversal and enforces workspace/CWD containment. - Linked-User & Consent Safety:
mergeContacts()refuses merging two contacts linked to different positivelinked_user_idaccounts;Accountprofile sync never matches by phone number; and unauthenticatedFormssubmissions never overwrite an existing opted-out contact’smarketing_opt_in.