From 92bcaef0fc69608b517ed7f8888f600e77da8126 Mon Sep 17 00:00:00 2001 From: charithag Date: Thu, 23 Jul 2015 22:33:44 +0530 Subject: [PATCH] Add permissions required to grouping --- .../jaggeryapps/iotserver/modules/utility.js | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/utility.js b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/utility.js index 917e86a0..94dbd066 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/utility.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/utility.js @@ -60,6 +60,28 @@ utility = function () { name: "Perform Operation" }], "device-mgt/admin", type); + userModule.addPermissions([{key: "groups", name: "Groups"}], "device-mgt/admin", type); + userModule.addPermissions([{ + key: "groups/add_devices", + name: "Add Devices to Group" + }], "device-mgt/admin", type); + userModule.addPermissions([{ + key: "groups/remove_devices", + name: "Remove Devices from Group" + }], "device-mgt/admin", type); + userModule.addPermissions([{ + key: "groups/modify", + name: "Modify Group" + }], "device-mgt/admin", type); + userModule.addPermissions([{ + key: "groups/share", + name: "Change Group Sharing" + }], "device-mgt/admin", type); + userModule.addPermissions([{ + key: "groups/delete", + name: "Delete Group" + }], "device-mgt/admin", type); + userModule.addPermissions([{key: "users", name: "Users"}], "device-mgt/admin", type); userModule.addPermissions([{ key: "users/add", @@ -88,35 +110,15 @@ utility = function () { name: "Perform Operation" }], "device-mgt/user", "init"); - // Group Management Permissions + userModule.addPermissions([{key: "groups", name: "Groups"}], "device-mgt/user", type); userModule.addPermissions([{ key: "groups/monitor", name: "Monitor Devices in Group" - }], "group-mgt/user", "init"); + }], "device-mgt/user", type); userModule.addPermissions([{ key: "groups/operation", name: "Perform Device Operation" - }], "group-mgt/user", "init"); - userModule.addPermissions([{ - key: "groups/add_devices", - name: "Add Devices to Group" - }], "group-mgt/user", "init"); - userModule.addPermissions([{ - key: "groups/remove_devices", - name: "Remove Devices from Group" - }], "group-mgt/user", "init"); - userModule.addPermissions([{ - key: "groups/modify", - name: "Modify Group" - }], "group-mgt/user", "init"); - userModule.addPermissions([{ - key: "groups/share", - name: "Change Group Sharing" - }], "group-mgt/user", "init"); - userModule.addPermissions([{ - key: "groups/delete", - name: "Delete Group" - }], "group-mgt/user", "init"); + }], "device-mgt/user", type); }; return publicMethods;