Skip to content
Corex

AccessMatrix

Corex\Config\Access\AccessMatrix · class · Config layer

Pure model for Access & Abilities (spec 065 baseline, spec 067 tabs). It builds a truthful role × capability matrix, role summaries, and permissions-plugin conflict detection from the REAL WordPress roles, native capability compatibility inputs, and editable CoreX-owned ability effects. It invents no corex_* capability that does not exist (CoreX admin is gated on manage_options). WordPress-free, so it is unit-testable.

The capability groups shown, each mapped to the REAL WordPress capability it checks. risk marks capabilities that unlock site administration; locked marks requirements hard-coded in CoreX (the admin gate is manage_options in code — not editable anywhere).

roleSummaries(array $roles, array $userCounts): array

Section titled “roleSummaries(array $roles, array $userCounts): array”

Role summary cards (design: Access overview) — per role, the REAL user count, whether the role is a WordPress core role or a custom one, and how many tracked abilities it holds.

Which known role/capability-manager plugins are REALLY active (design: overview compatibility notice). Returns their display names; empty when none is active.

Build the matrix: one row per capability group, one cell per role indicating whether that role really holds the capability.

editableCorexMatrix(array $roles, array $effectsByRole, array $activePlugins): array

Section titled “editableCorexMatrix(array $roles, array $effectsByRole, array $activePlugins): array”

Build the editable CoreX-owned ability matrix. Native WordPress/platform capabilities stay outside this mutation model; external role plugins are surfaced as compatibility context only.

Which of the tracked capabilities the current user holds — for the “your permissions” summary.