feat(rbac): frontend route-guard + nav filter (PR B — frontend) #586
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#586
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/rbac-prb-frontend"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
PR B (frontend) к backend RBAC из PR #585.
Реализует требования из Telegram-сессии 2026-05-25:
Что включено (14 files, +834/-91)
Main
frontend/:src/lib/useMe.ts— TanStackuseMe(),staleTime: Infinity, читает GET/api/v1/mesrc/lib/isPathAllowed.ts— JS port_glob_to_regexизbackend/app/core/auth.pysrc/lib/__tests__/isPathAllowed.test.ts— parity tests vs backendtest_rbac.pysrc/components/auth/RouteGuard.tsx— wraps app, 403 → NoAccessScreen, loading → nullsrc/components/auth/NoAccessScreen.tsx— fullscreen «Доступа нет» с<Lock>lucidesrc/components/landing/TopNav.tsx— extracted nav, filtered viaisPathAllowed(scope, href)src/app/{layout.tsx, page.tsx}— wrap в RouteGuard, inline nav →<TopNav>Tradein mirror (
tradein-mvp/frontend/):src/lib/{useMe,isPathAllowed}.ts— MIRROR с basePath-aware URLsrc/components/auth/{RouteGuard,NoAccessScreen}.tsx— MIRROR, tokenized colors per.claude/rules/ui-tokens.mdsrc/components/trade-in/Topbar.tsx— scraper tabs (Avito/Cian/Yandex/N1) hidden для pilotsrc/app/layout.tsx— wrap в RouteGuardSecurity verification (code-reviewer LGTM)
_glob_to_regexTest plan
npm run type-checkв CI на обоих frontends после merge (locally нет node_modules)Follow-ups (nits, не блокирует merge)
/trade-in/scrapers/avito— UI page рендерится (yaml allows/trade-in/**), но data fetches 403. Если нужен hard-block UI — добавить/trade-in/scrapers/**вpilot.denyвauth/roles.yaml(отдельный PR).Topbar.tsxscraper tabs используют синтетическиеscopePath(/trade-in/api/v1/admin/scrapers/avito) для filter logic — readability nit, можно переименовать наrequiresAdmin: trueboolean (отдельный PR).Depends on #585 (merged).