Guides

Test suite for sign-in, workspace role checks, and protected-route guards

Use this suite to check the paths that decide who may open a screen in a college workspace. It inventories the risky paths already described in this pack, states the gap for each one, and gives one matrix for allowed access, denied access, expired sessions, and role boundary cases. The checker on this page is example only and sends nothing and saves nothing. The server check on every request governs in the signed-in app.

Inventory of untested risky code in this pack

Read this table before changing a guard. Each row names the path as described in this pack, the risk if the path is wrong, what the pack already checks on a page, and the gap this suite closes. No row adds a sign-in path, a role, or a permission.

Risky path, risk, current page coverage, and gap
PathRisk if wrongCoverage in this pack todayGap closed by this suite
MAJIC sign-in entry and preserved destination, at /app/ with a next pathAn external address, a token, or question text in the destination sends a person to the wrong place or carries private text in the page addressSign-in and session recovery keeps a same-origin destination only and rejects an external or token destination in its toolNo matrix case for an encoded slash, a hash, a query string, or a destination that no longer exists or no longer covers the role
Session expiry with a typed draftA queued question, rating, or save is auto-sent after sign-in, or a draft for one college is carried into another collegeThe recovery guide states no auto-send, review before send, and discard on college changeNo page check for discard on college change, for a failed sign-in loop, or for session-only mode stating that no draft is kept
Workspace load and college confirmationWork is added in the wrong college workspace, or an empty list is read as zero work for the correct collegeFirst login with no workspace, Get started friction log, and the stall map state stop and switch workspaceNo case for no workspace shown, wrong college shown, and load failure followed by a 401 on retry
Workspace role checks in TeamA pending invite is read as an active role, or a person approves a submission that person submitted or builtRole first-run checklists and the workspace member audit state active role and different approverNo boundary matrix for pending invite, role removed mid-session, role changed and Check again, and submitter as approver for a source and for an assistant
Protected-route guards, the 403 caseA retry loop for a step the role cannot cover, a button that does nothing, or a saved link that reopens a step after a role changeThe recovery guide simulates one 403 with no retry and a named covering roleNo case for Check again only after a confirmed role change, and no case for a saved link after role removal
Separate detail and export permissionsFull question text is viewed, or report detail is exported, without the separate permission, or the view and export are not audit loggedSet retention and access and Read reports state the separate permission and audit entryNo test links the permission to the 403 screen, the audit entry, and the filters and row count on the export record
Test and session-only exclusionA test session creates a saved record, a follow record, or a count, or a session-only college claims a record was savedMany guides state test sessions are labeled as test and excluded, and session-only mode keeps nothing after the session endsNo auth case for a test session opening a protected step and for a session-only save screen

Scope note. This pack holds public guides only. It holds no Worker code, no route module, and no server test file, so no server path can be quoted from this pack. This suite states the cases a signed-in app test must cover from the rules already stated in the guides above. It does not change any guard.

Test matrix for allowed, denied, expired, and boundary cases

Run each case in a test college workspace with test recipients. Record the correlation ID, the response category, the route, the college, and the assistant for each result. A case passes only when the response, the screen, and the kept work all match.

Test case, setup, action, expected response and screen, and kept work
CaseSetupExpected response and screenKept or cleared
A1 Allowed, valid sessionSigned in, college name at the top matches the workspace, role covers Ask200 with data. Ask opens for a published assistant in that collegeTyped question stays in its field. No failure screen
A2 Allowed, approver different personApprover holds an active approver role and did not submit the source or build the assistant200 with data. Sources opens the source in review with approve and return actionsApproval record shows reviewer name, decision, note, and date
A3 Allowed, viewer opens shared collectionViewer role assigned in Team for that college, signed in, college confirmed200 with data. Collection opens with source title, source link, and last checked dateNo edit or approve control is shown
A4 Allowed, admin sets retentionCollege administrator role, Governance open for that college and assistant200 with data. Rule saves and audit entry shows who set it, when, and for which college and assistantNew chat confirms the rule applies
D1 Denied, no workspaceSigned in, no workspace for the college is shownStop screen. No work added in another college and no create workspace stepNo draft carried to another college
D2 Denied, no roleWorkspace shown, Team shows no active role for the accountRequest access screen naming the college administrator and the role and task fieldsNo role step button is shown
D3 Denied, wrong collegeCollege name at the top does not match the intended collegeStop and switch workspace before any add or openTyped text for the wrong college is not shown in the correct college
D4 Denied, visitor personal questionNo account, website widget, personal topicSign-in request or named handoff office. No student record shown in publicPublic approved sources only
D5 Denied, role does not cover stepStudent role tries to approve a source403. Screen names the approver role and links to Approve a sourceDraft kept. No Try again loop and no button that does nothing
D6 Denied, no detail or export permissionRole covers Reports but separate detail or export permission is not held403 with a plain reason. No full question text and no export fileCounts and themes only. No audit entry for a view that did not happen
E1 Expired, mid-draftSession ends while a question draft is typed in the same college401. Session-ended screen with correlation ID and Sign in again and continueDraft restored after sign-in. Nothing auto-sent. Review before send
E2 Expired, deep link while signed outDeep link to a valid same-origin app path opened while signed out401 with preserved destination named in plain wordsOnly same-origin path and safe filter keys. No token or question text in the destination
E3 Expired, unsafe destinationDestination holds an external address, a token, or question textDestination rejected to Today with an explanation and a correlation IDNo external navigation and no private text in the page address
E4 Expired, failed sign-inSign-in fails after a 401Failure screen again with a new correlation ID. No bounce loopPreserved destination kept for the next sign-in attempt
B1 Boundary, self-approvalSubmitter tries to approve the same source or assistant403. Screen names a different approver roleSubmission stays in review. No approval record for the submitter
B2 Boundary, pending inviteApprover invite sent, Team does not yet show an active roleSource cannot be submitted for approval. Invite is not readyNo approval by a pending invite
B3 Boundary, role removed mid-sessionCovering role is removed after a screen opens403 on the next request. Saved link from before the change does not reopen the stepTyped text kept for the same college. Server check governs
B4 Boundary, role changed to coverRole change is confirmed in Team after a 403Check again appears only now. Next request opens the stepNo retry loop before the confirmed change
B5 Boundary, system viewSystem office governance staff open Reports in system viewTotals grouped by college only. No question textNo cross-college join and no person detail
B6 Boundary, test sessionTest or staff preview session opens a protected stepScreen labeled as test. No saved record, no follow record, no countTest exclusion shown where the screen can count it
B7 Boundary, session-only saveCollege uses session-only mode and a save is attemptedScreen states nothing is kept after the session endsNo saved claim is made
B8 Boundary, destination no longer worksPreserved destination was removed or the role no longer covers itFailure screen for that destination with its own correlation ID and Open TodayNo silent landing on a home screen with no explanation

Run an example check on this page

Example only. Nothing entered here is sent to a server and nothing is saved. Use the result to confirm the order of checks in the matrix, then run the same case in a test college workspace. A category can be allowed only when the session is valid, the college matches, the role is active and covers the step, and any separate permission the step needs is held.

Fields marked are required.

Choose the session state for the example.

Only view and export steps need this check in this example.

Choose each field, then choose Run example check.

    Checks before you ship a guard change

    Run each check in a test college workspace on phone and desktop, with keyboard and screen reader. If a check fails, fix it before a live send.

    • Run A1 to A4 and confirm each allowed case opens with data and no failure screen, and the audit entry matches where the guide requires one
    • Run D1 to D6 and confirm each denied case names the next action, shows no button that does nothing, and keeps no work from another college
    • Run E1 to E4 and confirm return to the same screen with the draft restored, nothing auto-sent, and a new correlation ID after a failed sign-in
    • Run B1 to B8 and confirm self-approval and pending invite are blocked, a saved link does not reopen a step after role removal, and Check again appears only after a confirmed role change
    • Confirm test sessions are labeled as test and excluded, session-only mode states its rule, and an app failure is not counted as not answered
    • Confirm focus is visible, controls are at least 44 pixels high, the failure is announced once, and the heading and filters stay visible

    Follow Sign-in, session, and workspace recovery for the failure screen, Role first-run checklists for the first session by role, Workspace member and role audit for orphan and duplicate checks, Set retention and access for permission rules, and Read reports for counts by college and assistant.

    Next guide

    Recover from a failed sign-in, session, or workspace load without losing work.