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) <noreply@anthropic.com>
This commit is contained in:
2026-06-11 11:48:36 +02:00
parent 17f6010a93
commit 0adc2d4300
+7 -6
View File
@@ -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