Content availability API
Aztec staff switch a Collection or Class On or Off for a customer or an organization node. Content is unavailable by default. Only aztec_staff users call these routes.
| Operation | Route | Notes |
|---|---|---|
| Set | PUT /api/content-availability | Body: nodeId, contentId, contentLevel (collection, class), available (true or false). |
| Clear | DELETE /api/content-availability?nodeId=&contentId= | The node goes back to inheriting. |
| Read | GET /api/content-availability?contentId= | The tree of customers and organizations. Each item has setting (on, off or null), available, inheritedFromId, inheritedFromName, locked and activeAssignments. |
Errors
401 not signed in. 403 not aztec_staff. 404 node or content not found. 422 an unknown contentLevel, or switching On below a node where the content is Off.
Rules
- A node is available only when a node at or above it, up to its customer, is On and none is Off. Off always wins.
- A setting never crosses the customer boundary.
- A Class also honours the setting of its parent Collection. Collection Off covers its Classes. Assigning a whole Collection checks only the Collection.
- Switching Off or clearing stops new assignments only. Active assignments, due-date changes and cancellation are untouched.
- The check fails closed: if availability can't be read, the assignment is not saved.
Other features
Creating an assignment (POST /api/assignments, see Content assignment API) returns 422 for unavailable content. The assignment content search leaves unavailable content out. Other features use IContentAvailability from the feature's Contracts namespace.
Audit and telemetry
Every set or clear adds a row to the append-only ContentAvailabilityAudit table. Events: availability_changed and assignment_blocked_unavailable. Rows written by the launch migration have updated_by = 'Migration' and no audit row.