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
- 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). - Role Assignment: Menus are explicitly assigned to Roles.
- 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 Name | Path | Associated Auth Code | Description |
|---|---|---|---|
| Dashboard | /dashboard | - | Root catalog for dashboard items. |
| └ Analytics | /dashboard/analytics | Dashboard:Analytics | Analytics and statistics view. |
| └ Workspace | /dashboard/workspace | Dashboard:Workspace | Personal workspace view. |
| Business | /business | - | Root catalog for business modules. |
| └ Finance | /business/finance | Business:Finance | Finance management module. |
| Inventory | /inventory | - | Root catalog for inventory modules. |
| └ Overview | /inventory/overview | Inventory:Overview | Inventory status overview. |
| System | /system | - | Root catalog for system administration. |
| └ IAM | /system/iam | - | Identity & Access Management group. |
| └ User Management | /system/user | System:User:List | Manage system users. |
| └ Dept Management | /system/dept | System:Dept:List | Manage organizational departments. |
| └ Role Management | /system/role | System:Role:List | Manage roles and permissions. |
| └ Resources | /system/resources | - | System resource management group. |
| └ Menu Management | /system/menu | System:Menu:List | Critical: Configure these menu items. |
| └ Dict Management | /system/dict | System:Dict:List | Manage data dictionaries. |
| └ File Management | /system/file | System:File:List | Manage uploaded files. |
| └ Operations | /system/operations | - | Operational tools group. |
| └ Notice Management | /system/notice | System:Notice:List | System-wide announcements. |
| └ Log Management | /system/log | System:Log:List | View system access and operation logs. |
| └ Config Management | /system/config | System:Config:List | Global system configurations. |
| └ API Management | /system/api | System:Api:List | Manage backend API permissions. |
| └ Session Management | /system/session | System:Session:List | Manage 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
authCodeis 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.