Skip to content

Commit 5c234e8

Browse files
committed
Fix name bug when starting from a fresh database
1 parent 2c0ebba commit 5c234e8

5 files changed

Lines changed: 10 additions & 6 deletions

File tree

OpenFlow/src/DatabaseConnection.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,9 @@ export class DatabaseConnection {
852852
if (collectionname === "users" && !NoderedUtil.IsNullEmpty(item._type) && !NoderedUtil.IsNullEmpty(item.name)) {
853853
if ((item._type === "user" || item._type === "role") &&
854854
(this.WellknownNamesArray.indexOf(item.name) > -1 || this.WellknownNamesArray.indexOf((item as any).username) > -1)) {
855-
throw new Error("Access denied");
855+
if (this.WellknownIdsArray.indexOf(item._id) == -1) {
856+
throw new Error("Access denied");
857+
}
856858
}
857859
}
858860
j = ((j as any) === 'true' || j === true);
@@ -1017,7 +1019,9 @@ export class DatabaseConnection {
10171019
if (collectionname === "users" && !NoderedUtil.IsNullEmpty(item._type) && !NoderedUtil.IsNullEmpty(item.name)) {
10181020
if ((item._type === "user" || item._type === "role") &&
10191021
(this.WellknownNamesArray.indexOf(item.name) > -1 || this.WellknownNamesArray.indexOf((item as any).username) > -1)) {
1020-
throw new Error("Access denied");
1022+
if (this.WellknownIdsArray.indexOf(item._id) == -1) {
1023+
throw new Error("Access denied");
1024+
}
10211025
}
10221026
}
10231027
item._version = 0;

OpenFlowNodeRED/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/nodered",
3-
"version": "1.3.16",
3+
"version": "1.3.17",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.16
1+
1.3.17

docker-compose-traefik.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ services:
3838
- "traefik.frontend.passHostHeader=true"
3939
image: "openiap/openflow"
4040
deploy:
41-
replicas: 2
41+
replicas: 1
4242
pull_policy: always
4343
restart: always
4444
volumes:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/openflow",
3-
"version": "1.3.16",
3+
"version": "1.3.17",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)