diff --git a/src/interactors/GetData.js b/src/interactors/GetData.js index d46a813..ba94617 100644 --- a/src/interactors/GetData.js +++ b/src/interactors/GetData.js @@ -13,8 +13,8 @@ class GetData { } const authDevice = await this.cloud.getDevice(credentials, credentials.uuid); - if (authDevice.type !== 'knot:app') { - throwError('Only apps can send \'getData\'', 400); + if (authDevice.type !== 'knot:app' && authDevice.type !== 'knot:users') { + throwError('Only apps and users can send \'getData\'', 400); } await this.cloud.sendMessage(credentials, data.id, 'command', { name: 'getData', args: data.sensorIds }, authDevice.knot.router); diff --git a/src/interactors/SetData.js b/src/interactors/SetData.js index 87746d5..ba76c3f 100644 --- a/src/interactors/SetData.js +++ b/src/interactors/SetData.js @@ -14,8 +14,8 @@ class SetData { } const authDevice = await this.cloud.getDevice(credentials, credentials.uuid); - if (authDevice.type !== 'knot:app') { - throwError('Only apps can send \'setData\'', 400); + if (authDevice.type !== 'knot:app' && authDevice.type !== 'knot:user') { + throwError('Only apps and users can send \'setData\'', 400); } const device = await this.cloud.getDevice(credentials, data.id, authDevice.knot.router);