diff --git a/src/frontend/shared/nav-rail-panel.story.vue b/src/frontend/shared/nav-rail-panel.story.vue new file mode 100644 index 00000000..9fe099d2 --- /dev/null +++ b/src/frontend/shared/nav-rail-panel.story.vue @@ -0,0 +1,59 @@ + + + + + +# Nav rail panel + +Sidebar navigation with role-based visibility. + +## Subscription gating + +Links controlled by `config.subscriptions` via `subscribed('feature')`: Streams, Stories, Pages, Resources, Invitations, Audience, Interface. + +## Admin gating + +Requires `isAdmin && subscribed(...)`: + +- **Invitations** +- **Settings** + +## Admin only + +Requires `isAdmin`: + +- **Team** + +Compare the **Admin** and **Editor** variants: editors see content links but not Invitations, Settings, or Team. + diff --git a/src/frontend/shared/nav-rail-panel.vue b/src/frontend/shared/nav-rail-panel.vue index f40d7fd4..0d6a9ff5 100644 --- a/src/frontend/shared/nav-rail-panel.vue +++ b/src/frontend/shared/nav-rail-panel.vue @@ -37,7 +37,7 @@ > Invitations locale === 'en', }; +export const adminUser: AppUserInterface = { + ...user, + role: 'admin', + isAdmin: true, +}; + +export const editorUser: AppUserInterface = { + ...user, + role: 'editor', + isAdmin: false, +}; + export const stories = ['John', 'Acts']; export const story: StorySpec = {