Skip to content

Commit d05ed57

Browse files
committed
fix(content): verified access flows, docs screenshots and not-found pages
- Render a plugin route's notFound screen inside the route's own messages, and skip its breadcrumb when there is no loader data, so a hidden or missing forum shows "Forum not found" instead of a server error - Show a restricted attachment without the deleted-file strikethrough - Word the inherit hints in the Access sheet as what Inherit resolves to - Add real screenshots of the Access sheet, effective access, the guest forum list and sign-in state, the restricted attachment and the article editor notice to the access docs - Ignore storage/private in the web app Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CnAiFc4gJkRmXr1TwfkSNX
1 parent 68ce38e commit d05ed57

15 files changed

Lines changed: 94 additions & 16 deletions

File tree

‎apps/web/.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ dist-ssr
1212
.vinxi
1313
__unconfig*
1414
todos.json
15+
16+
# Local storage adapter private files
17+
/storage/private
11.9 KB
Loading

‎apps/web/content/docs/content-engine/access-attachments.mdx‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ description: Keep the files of restricted VitNode content private. Configure a p
44
icon: FileLock
55
---
66

7+
import { ImgDocs } from "@/components/fumadocs/img";
8+
import attachmentRestricted from "./access-attachment-restricted.webp";
9+
710
A rule on **Download attachments** only protects files nobody can fetch by URL. This guide sets up private storage, so files of access-controlled content are served only through a route that checks the reader every time, and moves the files that are still public.
811

912
## How files are served
@@ -14,7 +17,15 @@ Every content type with access rules gets a download route, `GET /api/{plugin}/c
1417
2. the file belongs to that record: a file field holds it, or one of its rich-text documents names it;
1518
3. for anything but an image, the reader may also **download attachments**.
1619

17-
Images follow **Read**: anyone who can read an article sees its images, and anyone who can see an image can save a copy of it. **Download attachments** covers files offered for download, such as PDFs and archives. A reader without it sees **An attachment is available. You do not have permission to download it.**, with no name, size or link. File fields work the same way, with `restricted: true` on the descriptor.
20+
Images follow **Read**: anyone who can read an article sees its images, and anyone who can see an image can save a copy of it. **Download attachments** covers files offered for download, such as PDFs and archives. A reader without it sees **An attachment is available. You do not have permission to download it.**, with no name, size or link:
21+
22+
<ImgDocs
23+
withoutBackground
24+
src={attachmentRestricted}
25+
alt="A topic for a member without the download rule: the paragraph above the attachment, then a dashed box with a locked file icon, An attachment is available. and You do not have permission to download it."
26+
/>
27+
28+
File fields work the same way, with `restricted: true` on the descriptor.
1829

1930
Responses are `private, no-store`, `nosniff` and sandboxed. Nothing is served through a signed URL, so taking a role away blocks the next download at once.
2031

‎apps/web/content/docs/content-engine/access-categories.mdx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ implementation:
1616
href: /docs/content-engine/access-api
1717
---
1818

19+
import { ImgDocs } from "@/components/fumadocs/img";
20+
import categoryNotice from "./access-category-notice.webp";
21+
1922
A content type can hold access scopes of its own: every record gets view, read, comment and download rules, like a forum does. The Blog plugin uses this for categories, and an article is readable only when **every** one of its categories allows it.
2023

2124
Use it when the scopes are records you already manage in the AdminCP, such as categories or tags, rather than a [container tree](/docs/content-engine/access). The actions, audiences and prerequisites are the same as for containers.
@@ -81,6 +84,12 @@ Open **AdminCP → Categories** (`/admin/content/blog/categories`). In a categor
8184

8285
The article editor shows **Who can see this** under the categories field. It asks the server what the selected categories require together, so it is right before you save.
8386

87+
<ImgDocs
88+
withoutBackground
89+
src={categoryNotice}
90+
alt="The article editor with the categories News and Insiders selected, and the Who can see this panel below: View Everyone, Read, Comment and Download attachments Members with VIP, and a note that a reader has to meet the rule of every category"
91+
/>
92+
8493
</Step>
8594

8695
</Steps>
25.6 KB
Loading
51.3 KB
Loading
28.5 KB
Loading
95.7 KB
Loading
17.2 KB
Loading

‎apps/web/content/docs/content-engine/access.mdx‎

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ implementation:
2020

2121
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
2222

23+
import { ImgDocs } from "@/components/fumadocs/img";
24+
import effectiveChild from "./access-effective-child.webp";
25+
import forumRestricted from "./access-forum-restricted.webp";
26+
import accessSheet from "./access-sheet.webp";
27+
import signIn from "./access-sign-in.webp";
28+
2329
Access rules decide who may see a container, read what is filed in it, reply there and download its attachments. Use them for a staff-only forum, a members-only board, or a VIP section that only some roles can open.
2430

2531
This guide uses the Forum plugin: the `forum.forums` collection, topics filed into forums and comments that follow their topic.
@@ -94,10 +100,14 @@ Turn access on only when every custom route of the plugin that reads topics or c
94100

95101
Open **AdminCP → Forums** (`/admin/containers/forum/forums`). In a forum's row menu, choose **Access**.
96102

97-
{/* Image prompt: AdminCP Access sheet for the forum "Members", with View set to Signed-in members, Read inheriting, and the Effective access panel listing "Signed-in members - set here" for each action */}
98-
99103
Set **View** to **Signed-in members** for a forum called "Members", and choose **Save access**. Every action left on **Inherit** follows the nearest parent forum that sets it, then the collection's defaults. The **Effective access** panel below the fields shows what applies once parent forums are counted, and updates as you change the fields.
100104

105+
<ImgDocs
106+
withoutBackground
107+
src={accessSheet}
108+
alt="The Access sheet of the Members forum in the AdminCP: View set to Signed-in members, Read, Comment and Download attachments on Inherit (Everyone), and the Effective access panel showing Signed-in members for every action"
109+
/>
110+
101111
Saving needs the collection's `can_edit` admin permission. The rules apply from the next request, including to members who are signed in right now.
102112

103113
</Step>
@@ -108,7 +118,15 @@ Saving needs the collection's `can_edit` admin permission. The rules apply from
108118

109119
Under "Members", create a forum called "VIP". Open its **Access** sheet, set **View** to **Selected roles** and pick a VIP role, then save.
110120

111-
A child can be stricter than its parent, never more open: to reach "VIP", a member has to pass the rules of "Members" too. With "General" left on **Inherit** beside it:
121+
A child can be stricter than its parent, never more open: to reach "VIP", a member has to pass the rules of "Members" too. Its **Effective access** panel lists both requirements:
122+
123+
<ImgDocs
124+
withoutBackground
125+
src={effectiveChild}
126+
alt="The Effective access panel of the VIP forum: every action needs Signed-in members, required by Members, a parent, and Members with VIP, set here"
127+
/>
128+
129+
With "General" left on **Inherit** beside it:
112130

113131
| Visitor | Members | General | VIP |
114132
| ----------------------------- | ------- | ------- | --- |
@@ -124,7 +142,21 @@ A child can be stricter than its parent, never more open: to reach "VIP", a memb
124142

125143
Sign out and open `/forum`. "Members" and its children are gone from the forum list, and `/forum/members` answers **Forum not found**, as if it never existed. Sign in as a member without the VIP role: "Members" and "General" appear, "VIP" does not. Search for a topic title from "VIP" as both visitors: only a member with the role finds it.
126144

127-
To try a forum readers may see but not read, set **View** to **Everyone** and **Read** to **Signed-in members**. Guests then see the forum with a **Restricted** label, and its page asks them to sign in instead of listing topics.
145+
To try a forum readers may see but not read, set **View** to **Everyone** and **Read** to **Signed-in members**. Guests then see the forum with a **Restricted** label:
146+
147+
<ImgDocs
148+
withoutBackground
149+
className="*:max-w-full"
150+
src={forumRestricted}
151+
alt="The forum list as a guest: General with its topic count and latest topic, and Announcements with a Restricted label and no counts"
152+
/>
153+
154+
Its page and its topics ask guests to sign in instead of showing anything. A signed-in member without access sees **You don't have access here** instead.
155+
156+
<ImgDocs
157+
src={signIn}
158+
alt="A topic page for a guest: a lock icon, Sign in to read this, a Sign in button and a link back to all forums"
159+
/>
128160

129161
## Related
130162

0 commit comments

Comments
 (0)