Explainer
What per-user login on a Node-RED dashboard really requires
Short answer
Node-RED Dashboard cannot scope tabs per user: it applies one gate to the whole application. The six-tab shop-floor layout — a public dashboard, two engineer-only tabs and one machine-entry tab per supervisor — needs a session layer on uibuilder or middleware that validates session, role and machine on every request. Hiding a tab is navigation, not authorization; the backend must reject out-of-scope requests itself.

On this page
- Can Node-RED Dashboard give every user a separate login?
- How many access levels does the six-tab layout actually need?
- Why is hiding a tab from the menu not authorization?
- What must the server-side check re-verify on every request?
- Can existing Node-RED community nodes do this without building from scratch?
- Where does the machine permission check go in the flow?
- What does one machine-entry request look like end to end?
- What is the decision for this shop-floor system?
- Questions asked
A Node-RED Dashboard cannot give each user a different set of tabs: its access control is one gate for the whole application, not a permission system per tab or per person. The six-tab shop-floor plan — one public production dashboard, two engineer-only pages, and one machine-entry tab per supervisor — therefore needs a session layer added around the flows, on uibuilder or HTTP middleware, that re-checks the session, the role and the machine on every server-side request before any data is read or written. This article walks through what that layer must decide, where the check belongs in the flow, and what one machine-entry request looks like when it passes and when it fails.
Can Node-RED Dashboard give every user a separate login? #
No — the stock Dashboard applies a single access gate to the whole application, so any user who passes it reaches every tab, and per-user or per-machine tab scoping has to come from a session layer added around the flows. The editor password and any HTTP node authentication protect surfaces of Node-RED itself; they do not express "supervisor 2 may write to machine 2 only". That statement is application logic, and no stock Dashboard setting encodes it.
How many access levels does the six-tab layout actually need? #
The six tabs split into four access boundaries: one public read-only view, two engineer-only write pages, three machine-entry pages each scoped to one supervisor, and engineer access across all of them, which makes four distinct server-side checks. Laying them out before building any menu keeps the permission matrix honest:
| Tab | Who may open it | Server-side check before the operation |
|---|---|---|
| Production dashboard | Anyone, no login | Respond with public summaries only; no stock details, no writes |
| Work order | Engineers | Valid session and engineer role before the write |
| Stock level | Engineers | Valid session and engineer role before the read |
| Machine 1 entry | Supervisor 1 and engineers | Valid session, role covers entry, machine list contains M-01 |
| Machine 2 entry | Supervisor 2 and engineers | Same three checks against M-02 |
| Machine 3 entry | Supervisor 3 and engineers | Same three checks against M-03 |
Count the permission entries this creates: three supervisors with one machine each give 3 entries, and two engineers covering the five protected tabs give 2 × 5 = 10, for 3 + 10 = 13 user-permission pairs to maintain. That is the real cost of the per-user requirement, and it is the number to weigh against the alternative of a badge field on a shared-login dashboard.
Why is hiding a tab from the menu not authorization? #
Hiding a tab is navigation, not authorization: the browser simply does not draw the menu entry, while the HTTP endpoint behind it still answers any request that names it, so the server must reject the call on its own. A determined user does not need the menu — the tablet's browser history, a shared bookmark or a hand-typed URL reaches the same handler. The server-side check in the flow is the only thing that stands between that request and your MySQL tables. The same distinction holds on other platforms; for example, the CSS approach to hiding tabs in Ignition Perspective changes only what the screen shows, and the platform documentation treats it the same way — presentation, not access control.
What must the server-side check re-verify on every request? #
Four things on every request: the session is valid and not expired, the user's role covers the operation, the requested machine is on that user's permission list, and the database write path runs behind the same check as the page render. Each point fails differently, so test them separately: an expired session, an engineer role used to reach a supervisor's machine tab, and a machine identifier substituted into an otherwise valid request should each end in a rejection before the MySQL node fires. One safety note belongs here: these entries feed work orders and breakdown records to the shop floor, so treat an authorization failure in this path as a process-safety defect, not a reporting nuisance.
Persistent state alone does not make an identity system. A logged-in user needs a session that expires, a logout that actually clears it server-side, and credentials stored hashed rather than in clear text — properties you get from a maintained authentication component and have to build yourself if you roll your own.
Can existing Node-RED community nodes do this without building from scratch? #
Partly: maintained nodes cover authentication, but none of them alone enforces role-plus-machine scoping on Dashboard tabs, so you compose a login node with your own middleware check rather than expect one package to deliver the whole matrix. Three documented options cover different slices:
- node-red-contrib-users limits access to HTTP-based flows — a simple user access control for the endpoints behind your pages.
- node-red-contrib-ldap-login authenticates against Microsoft Active Directory, built on the ldapjs client, which matters if the plant already manages users there.
- A published Dashboard 2 flow for a multi-user framework adds route-level authentication and permission control for simple actions such as button presses.
The general menu of dashboard security options, including what the stock gate does and does not cover, is in the article on what secures a Node-RED dashboard on an industrial controller. Where a documented component stops and your logic starts is always the same line: who the user is can come from a node; what this user may do to this machine on this request is yours.
Where does the machine permission check go in the flow? #
In the HTTP handler, before the MySQL query fires: read the session, look up the user's machine list, compare the machine identifier in the request, and return an authorization failure before any record is read or written. Concretely, the chain is HTTP in → session lookup → role and machine check (a function node returning a boolean and the user's machine list) → either a 403 response or the SELECT/INSERT. The same check must guard every route that touches protected data, including the ones that only read stock levels — a read leak is still a boundary failure.
What does one machine-entry request look like end to end? #
A machine-entry request either passes all three checks and writes one row, or fails one check and writes zero rows — there is no partial outcome, which is exactly the behavior that makes the layout auditable. Worked example, with example values:
- Supervisor 1 is logged in from the machine 1 tablet at 192.168.1.61. The session carries role supervisor and the machine list ["M-01"].
- A request arrives for the machine entry endpoint with machine set to M-02, output 120 pieces, scrap 4 pieces, plus start and finish times.
- Check 1, session valid: pass. Check 2, role covers data entry: pass. Check 3, M-02 in ["M-01"]: fail. The handler returns HTTP 403 and production_events gains 0 rows.
- The same tablet resubmits with machine set to M-01, output 120 pieces, scrap 4 pieces. All three checks pass, the handler returns success and 1 row is written.
- In that accepted row, apply the plant's counting rule before storing: if output is total pieces and scrap is counted within it, accepted output is 120 − 4 = 116 pieces. Decide and document that rule once; if output means accepted pieces, the row stores 120 and the scrap column stays descriptive only.
Note what did the work in the failing case: the browser never showed a machine 2 tab, but the rejection came from check 3 anyway. That is the design working as intended.
What is the decision for this shop-floor system? #
If per-user tab access is a hard requirement, the stock Dashboard cannot deliver it and the build goes through uibuilder or HTTP middleware with server-side role and machine checks on every request; if a badge field is enough attribution, skip logins entirely and keep one gate in front of the whole application. Between those poles, the honest middle path is a prototype: validate the forms and the MySQL schema with badge entry first, then add the session layer once the data model is proven. Budget for the 13 user-permission pairs above and for the four checks on every request — that is the whole cost of the per-user requirement, stated in numbers you can put in front of management before anyone writes a line of flow code.
Questions asked
Does password-protecting the Node-RED editor also protect my operator pages?
No. Editor credentials and the HTTP endpoints your flows expose are separate surfaces. Securing the editor defines nothing about who may open a Dashboard tab or submit a work order, so the operator application needs its own session and permission checks regardless of how well the editor is locked down.
Is a badge number typed into a form the same thing as a login?
No. A badge field records who submitted the record, which is attribution. A login authenticates the session and carries the right to perform the operation. Keep badge attribution for reporting even after real logins exist; the two answer different questions and should stay separate fields.
Can I keep usernames and passwords in a global variable?
A file-backed global variable can hold a user list for a prototype, but it gives you no credential hashing, no session expiry, no logout and no recovery path. For anything operators actually log in to, use a maintained authentication component and keep credentials out of flow-scoped variables.
Can MySQL user accounts enforce the per-machine rules instead?
Not on their own. If every tablet connects through one database account, MySQL grants cannot tell supervisors apart — that distinction lives in your application session. Separate least-privilege database accounts are still worth having as a second layer, but the machine scoping check has to run in the flow itself.


