feat(auth): disable write affordances for viewer role

This commit is contained in:
Nora
2026-06-22 15:20:05 -06:00
parent b8b679b108
commit f91d7b3b46
5 changed files with 166 additions and 103 deletions
+11
View File
@@ -5,6 +5,17 @@ import Inbox from "./Inbox";
import * as inboxApi from "@/lib/inbox-api";
import * as downloadModule from "@/lib/download";
// The Inbox page now gates the Resubmit/Dismiss BulkBars behind
// <RoleGate allow={["admin", "user"]}>. Tests need an "admin"
// principal so the bulk bar still renders — otherwise the
// SP8 resubmit-with-download assertion below has nothing to click.
vi.mock("@/auth/useAuth", () => ({
useAuth: () => ({
user: { id: 1, username: "test-admin", role: "admin" },
status: "authenticated",
}),
}));
afterEach(() => {
cleanup();
vi.unstubAllGlobals();