Skip to content

Menu Control & Permissions

In Nodesify Admin, menu visibility is tightly integrated with the Role-Based Access Control (RBAC) system. This ensures users only see navigation items relevant to their role and permissions.

How it Works

  1. Menu Definition: Menus are defined in the database (managed via System > Menu Management). Each menu item can optionally be linked to a specific Permission Code (authCode).
  2. Role Assignment: Menus are explicitly assigned to Roles.
  3. Dynamic Rendering: When a user logs in, the backend (/menus) returns only the menu tree assigned to their role. The frontend renders this tree dynamically.

Default Menu Structure & Permissions

The following table lists the default menu items seeded in the system and their associated permission codes (where applicable).

Menu NamePathAssociated Auth CodeDescription
Dashboard/dashboard-Root catalog for dashboard items.
└ Analytics/dashboard/analyticsDashboard:AnalyticsAnalytics and statistics view.
└ Workspace/dashboard/workspaceDashboard:WorkspacePersonal workspace view.
Business/business-Root catalog for business modules.
└ Finance/business/financeBusiness:FinanceFinance management module.
Inventory/inventory-Root catalog for inventory modules.
└ Overview/inventory/overviewInventory:OverviewInventory status overview.
System/system-Root catalog for system administration.
IAM/system/iam-Identity & Access Management group.
   └ User Management/system/userSystem:User:ListManage system users.
   └ Dept Management/system/deptSystem:Dept:ListManage organizational departments.
   └ Role Management/system/roleSystem:Role:ListManage roles and permissions.
Resources/system/resources-System resource management group.
   └ Menu Management/system/menuSystem:Menu:ListCritical: Configure these menu items.
   └ Dict Management/system/dictSystem:Dict:ListManage data dictionaries.
   └ File Management/system/fileSystem:File:ListManage uploaded files.
Operations/system/operations-Operational tools group.
   └ Notice Management/system/noticeSystem:Notice:ListSystem-wide announcements.
   └ Log Management/system/logSystem:Log:ListView system access and operation logs.
   └ Config Management/system/configSystem:Config:ListGlobal system configurations.
   └ API Management/system/apiSystem:Api:ListManage backend API permissions.
   └ Session Management/system/sessionSystem:Session:ListManage active user sessions.

Frontend Integration

The frontend application (apps/web-ele) fetches the user's menu structure from the backend API.

  • API Endpoint: GET /menus
  • Logic: The backend filters the complete menu list, returning only items that are assigned to the user's current Role.
  • Visibility: If a user does not have a menu assigned to their role, it will not appear in the API response, and thus will not be rendered in the sidebar.

Permission Code (authCode)

The authCode field serves as a bridge between the visual menu and the functional API permission.

  • When a menu with an authCode is assigned to a user, the system also grants them that specific permission code (e.g., System:User:List).
  • This allows the frontend to check hasPermission('System:User:List') to conditionally render buttons or elements within the page, not just the menu item itself.