# showEditDialog may have lock-out feature

**URL:** https://discourse.nodered.org/t/showeditdialog-may-have-lock-out-feature/99011
**Category:** Core Development
**Created:** [11 September 2025 10:32 UTC](https://discourse.nodered.org/t/showeditdialog-may-have-lock-out-feature/99011 "2025-09-11T10:32:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)
#### Post date: [11 September 2025 10:32 UTC](https://discourse.nodered.org/t/showeditdialog-may-have-lock-out-feature/99011/1 "2025-09-11T10:32:48Z")

</div>

Hi There,

Just wondering whether it's possible to prevent the edit dialog from being shown if it is requested/opened in a workspace that is locked.

from [this code](https://github.com/node-red/node-red/blob/9ad329e5a184cbd749f4cacf30ae775d1205eba6/packages/node_modules/%40node-red/editor-client/src/js/ui/editor.js#L1018-L1022):

```javascript
    function showEditDialog(node, defaultTab) {
        if (buildingEditDialog) { return }
        if (editStack.includes(node)) { return }
        buildingEditDialog = true;
        if (node.z && RED.workspaces.isLocked(node.z)) { return }

```

If I attempt to open an edit dialog on a workspace that is locked, then the `buildingEditDialog` flag is set to true and when I then attempt to open another dialog, the flag prevents the dialog from being opened.

Is that correct?

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [11 September 2025 11:14 UTC](https://discourse.nodered.org/t/showeditdialog-may-have-lock-out-feature/99011/2 "2025-09-11T11:14:38Z")

</div>

Hmm, at a glance, that looks like a bug. Can you raise an issue? (or even PR the one-liner to move that return up one line?

---

<div class="post-metadata">

### Author: ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)
#### Post date: [11 September 2025 11:46 UTC](https://discourse.nodered.org/t/showeditdialog-may-have-lock-out-feature/99011/3 "2025-09-11T11:46:17Z")

</div>

I can but will be later as I’m currently AFK.

I didn't test my theory but will do before raising issue or creating PR.

---

<div class="post-metadata">

### Author: ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)
#### Post date: [11 September 2025 16:38 UTC](https://discourse.nodered.org/t/showeditdialog-may-have-lock-out-feature/99011/4 "2025-09-11T16:38:23Z")

</div>

Just followed up and tried this out. Turns out that the `showEditDialog` function isn't called if a node is defined within a workspace that is locked. So the showEditDialog isn't called and the `buildingEditDialog` flag isn't set.

Something else is preventing the function from being called if a workspace is locked - what is blocking that call, I don't know.

So this is a non-issue, please move on, nothing to see here.

EDIT: here the [tab editor](https://github.com/node-red/node-red/blob/9ad329e5a184cbd749f4cacf30ae775d1205eba6/packages/node_modules/%40node-red/editor-client/src/js/ui/workspaces.js#L133-L135) edit is prevented and [here](https://github.com/node-red/node-red/blob/9ad329e5a184cbd749f4cacf30ae775d1205eba6/packages/node_modules/%40node-red/editor-client/src/js/ui/view.js#L3728-L3732) the node edit call is prevented if the workspace is locked.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [25 September 2025 16:38 UTC](https://discourse.nodered.org/t/showeditdialog-may-have-lock-out-feature/99011/5 "2025-09-25T16:38:58Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
