revert-dabc3590
Harshan Liyanage 7 years ago
parent c62df267f7
commit 2e6ba042b8

@ -20,6 +20,7 @@ function onRequest(context) {
var log = new Log("device-view.js");
var deviceType = context.uriParams.deviceType;
var deviceId = request.getParameter("id");
var owner = request.getParameter("owner");
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var autoCompleteParams = [
{"name" : "deviceId", "value" : deviceId}
@ -27,7 +28,7 @@ function onRequest(context) {
if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId);
var device = deviceModule.viewDevice(deviceType, deviceId, owner);
if (device && device.status != "error") {
var anchor = { "device" : { "id" : device.content.deviceIdentifier, "type" : device.content.type}};
var viewObject = {};

@ -20,12 +20,13 @@ function onRequest(context) {
// var log = new Log("device-view.js");
var deviceType = context["uriParams"]["deviceType"];
var deviceId = request.getParameter("id");
var owner = request.getParameter("owner");
var deviceViewData = {};
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
if (deviceType && deviceId) {
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var response = deviceModule.viewDevice(deviceType, deviceId);
var response = deviceModule.viewDevice(deviceType, deviceId, owner);
if (response["status"] == "success") {
deviceViewData["deviceFound"] = true;
deviceViewData["isAuthorized"] = true;

@ -20,11 +20,12 @@ function onRequest(context) {
// var log = new Log("device-view.js");
var deviceType = context["uriParams"]["deviceType"];
var deviceId = request.getParameter("id");
var owner = request.getParameter("owner");
var deviceViewData = {};
if (deviceType && deviceId) {
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var response = deviceModule.viewDevice(deviceType, deviceId);
var response = deviceModule.viewDevice(deviceType, deviceId, owner);
if (response["status"] == "success") {
deviceViewData["deviceFound"] = true;
deviceViewData["isAuthorized"] = true;

Loading…
Cancel
Save