Skip to content
Corex

AccessController

Corex\Config\Access\AccessController · class · Config layer

REST boundary for CoreX-owned abilities and access-request workflows. Two kinds of “no” leave here. A request that cannot be read (a parameter missing, of the wrong shape, or naming something CoreX does not have) is answered 400 and names the parameter: it is the same mistake however often it is sent. A request that can be read and that the service refuses for how things stand (a decision on a request no longer pending, a change the safety policy stops, a confirmation that confirms something else) is answered 200 with a result whose state is blocked.

__construct(AccessService $service, CorexAbilityCatalog $catalog, PendingAccessRequests $pending, AccessGrantService $grants, AccessGrantPresenter $presenter)

Section titled “__construct(AccessService $service, CorexAbilityCatalog $catalog, PendingAccessRequests $pending, AccessGrantService $grants, AccessGrantPresenter $presenter)”

requestAllowed(WP_REST_Request $request): bool

Section titled “requestAllowed(WP_REST_Request $request): bool”

catalog(WP_REST_Request $request): WP_REST_Response

Section titled “catalog(WP_REST_Request $request): WP_REST_Response”

role(WP_REST_Request $request): WP_REST_Response

Section titled “role(WP_REST_Request $request): WP_REST_Response”

previewRole(WP_REST_Request $request): WP_REST_Response

Section titled “previewRole(WP_REST_Request $request): WP_REST_Response”

applyRole(WP_REST_Request $request): WP_REST_Response

Section titled “applyRole(WP_REST_Request $request): WP_REST_Response”

pendingRequests(WP_REST_Request $request): WP_REST_Response

Section titled “pendingRequests(WP_REST_Request $request): WP_REST_Response”

createRequest(WP_REST_Request $request): WP_REST_Response

Section titled “createRequest(WP_REST_Request $request): WP_REST_Response”

previewDecision(WP_REST_Request $request): WP_REST_Response

Section titled “previewDecision(WP_REST_Request $request): WP_REST_Response”

decideRequest(WP_REST_Request $request): WP_REST_Response

Section titled “decideRequest(WP_REST_Request $request): WP_REST_Response”

Approval needs a note, an expiry and a confirmation (spec 112, FR-002); a refusal does not.

standingGrants(WP_REST_Request $request): WP_REST_Response

Section titled “standingGrants(WP_REST_Request $request): WP_REST_Response”

revokeGrant(WP_REST_Request $request): WP_REST_Response

Section titled “revokeGrant(WP_REST_Request $request): WP_REST_Response”