Build a task-to-grant worksheet
For each mandatory step, record the operation, target resource, actor, required authorization, reason, and observable success. Add a column for operations deliberately excluded. This forces the writer to distinguish useful access from access that happened to be available during preparation.
| Task | Illustrative grant | Expected boundary |
|---|---|---|
| Read a permitted sample report | reports:read | Returns the selected fixture |
| Edit the report | Not requested | Does not change the fixture |
| Read another owner’s report | No resource authority | No unauthorized disclosure |
| Optional report creation | Outside the core lesson | Separate extension and consent explanation |
These permission names and outcomes describe a hypothetical teaching system. They are not GitHub scope names or promises about its error responses. A real implementation must replace them with verified provider rules before publication.
Keep delegated user authority and application authorization separate in the worksheet. A successful consent screen does not prove the user owns or can access the resource selected later.
Prove the positive path with the narrow grant
Create an authorized disposable test context and identify the expected fixture before testing. Request only the documented minimum grant, run the mandatory lesson, and record the result without publishing credential values. If a required step fails, investigate the specific operation rather than immediately adding a broad administration permission.
Record what changed in the grant and why. A permission added because a debug command accessed an unrelated endpoint may indicate that the debug step should leave the beginner lesson. It does not automatically establish a new minimum requirement.
Use the acceptance brief to define success in terms of the lesson’s actual output. A token being issued is an intermediate event, not proof that the authorized task completed correctly.
Test denial without risking real data
Add negative cases for a missing required permission, an excluded write action, and a resource outside the test actor’s authority. Use harmless fixtures and the provider's supported test environment. Never probe another person's account to demonstrate a denial boundary.
Define expected observations carefully. The platform may conceal whether a resource exists or return a particular authorization error. Quote only verified behavior for the specific API. Do not invent a universal status code or imply that every failure proves the same permission problem.
A negative case should also inspect the relevant fixture state. A refusal message is useful evidence, but the excluded write must not have changed the object. Keep test identifiers and source references while excluding private payloads from publication.
Release the boundary alongside the example
The published packet should contain the task-to-grant worksheet, provider references, sanitized positive result, expected denial cases, and the limitations of the test. Mark any untested behavior rather than presenting an inferred minimum as demonstrated fact.
The source worksheet should distinguish current provider rules from your proposed acceptance method. This keeps an original teaching artifact from masquerading as an official security guarantee.
Approve the tutorial when a reader can explain each requested permission, complete the core path with it, and understand what remains outside the grant. The desired result is a justified authorization boundary, not merely a consent screen that stops interrupting the demonstration.
