From 0adc2d4300c472e54a305e9cd8cc82120121e0ae Mon Sep 17 00:00:00 2001 From: Kawa Date: Thu, 11 Jun 2026 11:48:36 +0200 Subject: [PATCH] Hide write-only features from TechN0 menu Read-only TechN0 users could see nav items for pages that immediately return a WriteGuard notice (transfer, versions, templates, bulk members/ sites, folder structure), landing them on empty screens. Add a `write` nav scope (HasProfile && Role >= TechN1) so those items no longer appear for N0. The Bulk and Config section headers drop out automatically since all their children are now write-scoped. Per-page guards remain intact. Co-Authored-By: Claude Opus 4.8 (1M context) --- Components/Layout/MainLayout.razor | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Components/Layout/MainLayout.razor b/Components/Layout/MainLayout.razor index 94966aa..1a17d4e 100644 --- a/Components/Layout/MainLayout.razor +++ b/Components/Layout/MainLayout.razor @@ -146,15 +146,15 @@ new("/permissions", "🔐", "tab.permissions", "", "profile"), new("/storage", "💾", "tab.storage", "", "profile"), new("/duplicates", "📋", "tab.duplicates", "", "profile"), - new("/versions", "🗂️", "versions.tab", "", "profile"), - new("/transfer", "📦", "nav.fileTransfer", "", "profile"), - new("/bulk-members", "👥", "tab.bulkMembers", "nav.section.bulk", "profile"), - new("/bulk-sites", "🌐", "tab.bulkSites", "nav.section.bulk", "profile"), - new("/folder-structure", "📁", "tab.folderStructure", "nav.section.bulk", "profile"), + new("/versions", "🗂️", "versions.tab", "", "write"), + new("/transfer", "📦", "nav.fileTransfer", "", "write"), + new("/bulk-members", "👥", "tab.bulkMembers", "nav.section.bulk", "write"), + new("/bulk-sites", "🌐", "tab.bulkSites", "nav.section.bulk", "write"), + new("/folder-structure", "📁", "tab.folderStructure", "nav.section.bulk", "write"), new("/user-audit", "👤", "tab.userAccessAudit", "nav.section.audit", "profile"), new("/user-directory", "📖", "nav.userDirectory", "nav.section.audit", "profile"), new("/reports", "📑", "nav.reports", "nav.section.audit", "profile"), - new("/templates", "📐", "tab.templates", "nav.section.config", "profile"), + new("/templates", "📐", "tab.templates", "nav.section.config", "write"), new("/scheduled-reports", "⏰", "nav.scheduledReports", "nav.section.admin", "admin"), new("/profiles", "⚙️", "nav.clientProfiles", "nav.section.admin", "admin"), new("/admin/users", "👥", "nav.userManagement", "nav.section.admin", "admin"), @@ -170,6 +170,7 @@ .Where(i => i.Scope switch { "profile" => Session.HasProfile, + "write" => Session.HasProfile && UserContext.Role >= UserRole.TechN1, "admin" => UserContext.Role == UserRole.Admin, "auth" => UserContext.IsAuthenticated, _ => true