Skip to content

Commit 5061742

Browse files
committed
add robot agent users role
1 parent 70abcc1 commit 5061742

4 files changed

Lines changed: 19 additions & 7 deletions

File tree

OpenFlow/src/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ async function initDatabase(): Promise<boolean> {
9696
root.removeRight(WellknownIds.root, [Rights.delete]);
9797
await DBHelper.Save(root, jwt);
9898

99+
var robot_agent_users: Role = await DBHelper.EnsureRole(jwt, "robot agent users", WellknownIds.robot_agent_users);
100+
robot_agent_users.addRight(WellknownIds.admins, "admins", [Rights.full_control]);
101+
robot_agent_users.removeRight(WellknownIds.admins, [Rights.delete]);
102+
robot_agent_users.addRight(WellknownIds.root, "root", [Rights.full_control]);
103+
if (Config.multi_tenant) {
104+
logger.debug("[root][users] Running in multi tenant mode, remove " + robot_agent_users.name + " from self");
105+
robot_agent_users.removeRight(robot_agent_users._id, [Rights.full_control]);
106+
} else if (Config.update_acl_based_on_groups) {
107+
robot_agent_users.removeRight(robot_agent_users._id, [Rights.full_control]);
108+
robot_agent_users.addRight(robot_agent_users._id, "robot agent users", [Rights.read]);
109+
}
110+
await DBHelper.Save(robot_agent_users, jwt);
99111

100112
admins.addRight(WellknownIds.admins, "admins", [Rights.full_control]);
101113
admins.removeRight(WellknownIds.admins, [Rights.delete]);

OpenFlowNodeRED/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openflow-nodered",
3-
"version": "1.0.87",
3+
"version": "1.0.88",
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": {
@@ -37,7 +37,7 @@
3737
"morgan": "^1.10.0",
3838
"node-red": "^1.1.2",
3939
"node-red-node-email": "^1.7.8",
40-
"openflow-api": "^1.0.19",
40+
"openflow-api": "^1.0.20",
4141
"os-service": "^2.2.0",
4242
"passport-saml": "^1.3.4",
4343
"passport-saml-metadata": "^2.3.0",
@@ -46,4 +46,4 @@
4646
"unhandled-rejection": "^1.0.0",
4747
"winston": "^3.3.3"
4848
}
49-
}
49+
}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.87
1+
1.0.88

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openiap",
3-
"version": "1.0.87",
3+
"version": "1.0.88",
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": {
@@ -58,7 +58,7 @@
5858
"morgan": "^1.10.0",
5959
"multer": "^1.4.2",
6060
"multer-gridfs-storage": "^4.2.0",
61-
"openflow-api": "^1.0.19",
61+
"openflow-api": "^1.0.20",
6262
"os-service": "^2.2.0",
6363
"passport": "^0.4.1",
6464
"passport-google-oauth20": "^2.0.0",
@@ -88,4 +88,4 @@
8888
"typescript": "^3.9.7",
8989
"webpack": "^4.43.0"
9090
}
91-
}
91+
}

0 commit comments

Comments
 (0)