row 202 round 2 (#1700): viewer in the access usage line and README; one viewer grant test (sage-1713 carry)

This commit is contained in:
2026-10-21 16:01:39 -05:00
parent 957214b3d9
commit c204bef731
3 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -1065,7 +1065,7 @@ command. A usage error exits 4 and a bus refusal 2.
```
mosaic access list --business ID [--json]
mosaic access grant --business ID --user ID --projects UUID|NAME,...|* --instances NAME,...|* --level collaborator [--expires ISO] --revision N
mosaic access grant --business ID --user ID --projects UUID|NAME,...|* --instances NAME,...|* --level collaborator|viewer [--expires ISO] --revision N
mosaic access revoke --business ID --user ID [--grant GID] --revision N
```
+1 -1
View File
@@ -16,7 +16,7 @@ import { refuseInsideAgent } from "./transport.mjs";
export const ACCESS_USAGE = [
"mosaic access list --business ID [--json]",
"mosaic access grant --business ID --user ID --projects UUID|NAME,...|* --instances NAME,...|* --level collaborator [--expires ISO] --revision N",
"mosaic access grant --business ID --user ID --projects UUID|NAME,...|* --instances NAME,...|* --level collaborator|viewer [--expires ISO] --revision N",
"mosaic access revoke --business ID --user ID [--grant GID] --revision N",
].join("\n");
+8
View File
@@ -98,6 +98,14 @@ test("grant writes one revision up, a receipt line, and the id in the file", asy
assert.equal(line.actor, "human");
});
test("a viewer grant writes the viewer level, one revision up", async (t) => {
const s = setup(t);
await run([...GRANT_BASE, "--projects", PROJECT, "--instances", "coder", "--level", "viewer", "--revision", "1"], s.deps);
const doc = s.read();
assert.equal(doc.revision, 2);
assert.equal(doc.grants[0].level, "viewer");
});
test("a second write appends a second receipt and leaves the first intact", async (t) => {
const s = setup(t);
await run([...GRANT, "--revision", "1"], s.deps);