diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js index 935d4071..845c2ea2 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js @@ -147,6 +147,7 @@ deviceModule = function () { if (deviceUnit.isExists()) { deviceTypeObject = {}; deviceTypeObject["name"] = deviceType.getName(); + deviceTypeObject["id"] = deviceType.getId(); var storeProperties = privateMethods.getStoreDefinition(deviceType.getName()); if (storeProperties) { deviceTypeObject["storeTitle"] = storeProperties.title; diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/policy.js b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/policy.js index 0e7d3f1e..c7501239 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/policy.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/policy.js @@ -26,6 +26,10 @@ policyModule = function () { var publicMethods = {}; var privateMethods = {}; + publicMethods.addPolicy = function (name, deviceType, policyDefinition) { + + }; + publicMethods.getPolicies = function () { //TODO-This method returns includes dummy policy data diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/user.js b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/user.js index e294a1e1..76894943 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/user.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/user.js @@ -256,15 +256,14 @@ userModule = function () { var server = new carbon.server.Server(url); var userManager = new carbon.user.UserManager(server, tenantId); var userList = userManager.listUsers(); - var i, userObject, email, firstname, lastname; + var i, username, userObject, email, firstname, lastname; for (i = 0; i < userList.length; i++) { - userObject = userManager.getUser(userList[i]); - email = userManager.getClaim(userList[i],"http://wso2.org/claims/emailaddress", null); - firstname = userManager.getClaim(userList[i],"http://wso2.org/claims/givenname", null); - lastname = userManager.getClaim(userList[i],"http://wso2.org/claims/lastname", null); - //log.info(userManager.getClaimsForSet(userList[i], new Array("http://wso2.org/claims/emailaddress", - // "http://wso2.org/claims/givenname", - // "http://wso2.org/claims/lastname"), null)); + username = userList[i]; + userObject = userManager.getUser(username); + email = userManager.getClaim(username,"http://wso2.org/claims/emailaddress", null); + firstname = userManager.getClaim(username,"http://wso2.org/claims/givenname", null); + lastname = userManager.getClaim(username,"http://wso2.org/claims/lastname", null); + //log.info(userManager.getClaimsForSet(username, "http://wso2.org/claims/emailaddress,http://wso2.org/claims/givenname,http://wso2.org/claims/lastname".split(","), null)); userObj = { "username" : userObject.username, "email" : email, diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/policy-create.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/policy-create.hbs index f6a93084..b7fb40b0 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/policy-create.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/policy-create.hbs @@ -1,21 +1,63 @@ + {{#zone "main"}} + + + + + + + + + +