Modify permissions.xml files in device type.

revert-dabc3590
NuwanSameera 9 years ago
parent 8656f84ac6
commit 1f0f449385

@ -21,7 +21,6 @@ public class AndroidSenseConstants {
public final static String DEVICE_TYPE = "android_sense";
public final static String DEVICE_PLUGIN_DEVICE_NAME = "DEVICE_NAME";
public final static String DEVICE_PLUGIN_DEVICE_ID = "ANDROID_DEVICE_ID";
public final static String DEVICE_TYPE_PROVIDER_DOMAIN = "carbon.super";
//Android Sense Stream definitions.
public static final String ACCELEROMETER_STREAM_DEFINITION = "org.wso2.iot.devices.accelerometer";
public static final String BATTERY_STREAM_DEFINITION = "org.wso2.iot.devices.battery";

@ -28,153 +28,153 @@
<PermissionConfiguration>
<APIVersion></APIVersion>
<!-- Device related APIs -->
<Permission>
<Permission>
<name>add sensor information</name>
<path>/login</path>
<path>/device-mgt/user/device/sensors</path>
<url>/device/sensors</url>
<method>POST</method>
<scope></scope>
<scope>android_sense_device</scope>
</Permission>
<Permission>
<name>Get light information</name>
<path>/login</path>
<path>/device-mgt/user/device/sensors/light</path>
<url>/device/*/sensors/light</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Get battery information</name>
<path>/login</path>
<path>/device-mgt/user/device/sensors/battery</path>
<url>/device/*/sensors/battery</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Get gps information</name>
<path>/login</path>
<path>/device-mgt/user/device/sensors/gps</path>
<url>/device/*/sensors/gps</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Get magnetic information</name>
<path>/login</path>
<path>/device-mgt/user/device/sensors/magnetic</path>
<url>/device/*/sensors/magnetic</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Get accelerometer information</name>
<path>/login</path>
<path>/device-mgt/user/device/accelerometer</path>
<url>/device/*/sensors/accelerometer</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Get rotation information</name>
<path>/login</path>
<path>/device-mgt/user/device/sensors/rotation</path>
<url>/device/*/sensors/rotation</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Get proximity information</name>
<path>/login</path>
<path>/device-mgt/user/device/sensors/proximity</path>
<url>/device/*/sensors/proximity</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Get gyroscope information</name>
<path>/login</path>
<path>/device-mgt/user/device/gyroscope</path>
<url>/device/*/sensors/gyroscope</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Get pressure information</name>
<path>/login</path>
<path>/device-mgt/user/device/sensors/pressure</path>
<url>/device/*/sensors/pressure</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Get gravity information</name>
<path>/login</path>
<path>/device-mgt/user/device/sensors/gravity</path>
<url>/device/*/sensors/gravity</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Get words information</name>
<path>/login</path>
<path>/device-mgt/user/device/sensors/words</path>
<url>/device/*/sensors/words</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Get words information</name>
<path>/login</path>
<path>/device-mgt/user/device/sensors/word</path>
<url>/device/*/sensors/words</url>
<method>POST</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>set word threshold information</name>
<path>/login</path>
<path>/device-mgt/user/device/sensors/words/threshold</path>
<url>/device/*/sensors/words/threshold</url>
<method>POST</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>delete words</name>
<path>/login</path>
<path>/device-mgt/user/device/sensors/words</path>
<url>/device/*/sensors/words</url>
<method>DELETE</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>get device stats</name>
<path>/login</path>
<path>/device-mgt/user/device/stats</path>
<url>/stats/device/*/sensors/*</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_device</scope>
</Permission>
<Permission>
<name>Get device</name>
<path>/device-mgt/user/devices/list</path>
<url>/devices/*</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Add device</name>
<path>/device-mgt/user/devices/add</path>
<url>/devices/register</url>
<method>POST</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Remove device</name>
<path>/device-mgt/user/devices/remove</path>
<url>/devices/*</url>
<method>DELETE</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Download device</name>
<path>/device-mgt/user/devices/add</path>
<url>/devices/*/download</url>
<method>GET</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
<Permission>
<name>Update device</name>
<path>/device-mgt/user/devices/update</path>
<url>/devices/*</url>
<method>POST</method>
<scope></scope>
<scope>android_sense_user</scope>
</Permission>
</PermissionConfiguration>

@ -39,7 +39,7 @@ import javax.ws.rs.core.Response;
@DeviceType(value = "arduino")
public interface ArduinoControllerService {
@Path("register/device/{deviceId}/{ip}/{port}")
@Path("device/register/{deviceId}/{ip}/{port}")
@POST
Response registerDeviceIP(@PathParam("deviceId") String deviceId, @PathParam("ip") String deviceIP,
@PathParam("port") String devicePort, @Context HttpServletRequest request);
@ -58,16 +58,16 @@ public interface ArduinoControllerService {
"from Arduino agent")
Response requestTemperature(@PathParam("deviceId") String deviceId, @QueryParam("protocol") String protocol);
@Path("sensor")
@Path("device/sensor")
@POST
@Consumes(MediaType.APPLICATION_JSON)
Response pushData(DeviceData dataMsg);
@Path("{deviceId}/controls")
@Path("device/{deviceId}/controls")
@GET
Response readControls(@PathParam("deviceId") String deviceId, @QueryParam("protocol") String protocol);
@Path("temperature")
@Path("device/temperature")
@POST
@Consumes(MediaType.APPLICATION_JSON)
Response pushTemperatureData(final DeviceData dataMsg, @Context HttpServletRequest request);
@ -75,7 +75,7 @@ public interface ArduinoControllerService {
/**
* Retreive Sensor data for the device type
*/
@Path("stats/device/{deviceId}/sensors/temperature")
@Path("device/stats/{deviceId}/sensors/temperature")
@GET
@Consumes("application/json")
@Produces("application/json")

@ -28,88 +28,83 @@
<PermissionConfiguration>
<APIVersion></APIVersion>
<!-- Device related APIs -->
<Permission>
<name>Register Device</name>
<path>/login</path>
<url>/register/device/*/*/*</url>
<path>/device-mgt/user/device/register</path>
<url>/device/register/*/*/*</url>
<method>POST</method>
<scope></scope>
<scope>arduino_device</scope>
</Permission>
<Permission>
<name>get device bulb statjs</name>
<path>/login</path>
<name>control bulb</name>
<path>/device-mgt/user/device/bulb</path>
<url>/device/*/bulb</url>
<method>GET</method>
<scope></scope>
<method>POST</method>
<scope>arduino_user</scope>
</Permission>
<Permission>
<name>get device temperature</name>
<path>/login</path>
<path>/device-mgt/user/device/temperature</path>
<url>/device/*/temperature</url>
<method>GET</method>
<scope></scope>
<scope>arduino_user</scope>
</Permission>
<Permission>
<name>get device temperature</name>
<path>/login</path>
<url>/device/*/temperature</url>
<method>GET</method>
<scope></scope>
</Permission>
<Permission>
<name>get device temperature</name>
<path>/login</path>
<url>/sensor</url>
<name>push data</name>
<path>/device-mgt/user/device/push-data</path>
<url>/device/sensor</url>
<method>POST</method>
<scope></scope>
<scope>arduino_device</scope>
</Permission>
<Permission>
<name>get controls</name>
<path>/login</path>
<path>/device-mgt/user/device/controls</path>
<url>/device/*/controls</url>
<method>POST</method>
<scope></scope>
<scope>arduino_device</scope>
</Permission>
<Permission>
<name>push temperature</name>
<path>/login</path>
<url>/temperature</url>
<path>/device-mgt/user/device/temperature</path>
<url>/device/temperature</url>
<method>POST</method>
<scope></scope>
<scope>arduino_device</scope>
</Permission>
<Permission>
<name>get temperature</name>
<path>/login</path>
<url>/stats/device/*/sensors/temperature</url>
<name>get temperature stats</name>
<path>/device-mgt/user/device/</path>
<url>/device/stats/*/sensors/temperature</url>
<method>GET</method>
<scope></scope>
<scope>arduino_device</scope>
</Permission>
<Permission>
<name>Get device</name>
<path>/device-mgt/user/devices/list</path>
<url>/devices/*</url>
<method>GET</method>
<scope></scope>
<scope>arduino_user</scope>
</Permission>
<Permission>
<name>Remove device</name>
<path>/device-mgt/user/devices/remove</path>
<url>/devices/*</url>
<method>DELETE</method>
<scope></scope>
<scope>arduino_user</scope>
</Permission>
<Permission>
<name>Download device</name>
<path>/device-mgt/user/devices/add</path>
<url>/devices/download</url>
<method>GET</method>
<scope></scope>
<scope>arduino_user</scope>
</Permission>
<Permission>
<name>Update device</name>
<path>/device-mgt/user/devices/update</path>
<url>/devices/*</url>
<method>PUT</method>
<scope></scope>
<scope>arduino_user</scope>
</Permission>
</PermissionConfiguration>
</PermissionConfiguration>

@ -26,6 +26,7 @@
it will result 403 error at the runtime.
-->
<PermissionConfiguration>
<APIVersion></APIVersion>
<!-- Device related APIs -->
<Permission>
@ -33,105 +34,105 @@
<path>/device-mgt/user/devices/list</path>
<url>/devices/*</url>
<method>GET</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name>Remove device</name>
<path>/device-mgt/user/devices/remove</path>
<url>/devices/*</url>
<method>DELETE</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name>Download device</name>
<path>/device-mgt/user/devices/add</path>
<url>/devices/*/download</url>
<method>GET</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name>Update device</name>
<path>/device-mgt/user/devices/update</path>
<url>/devices/*</url>
<method>POST</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Restart Browser</name>
<path>/device-mgt/user/device</path>
<url>/device/*/restart-browser</url>
<method>POST</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Terminate Display</name>
<path>/device-mgt/user/device/terminate-display</path>
<url>/device/*/terminate-display</url>
<method>POST</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Restart Display</name>
<path>/device-mgt/user/device/restart-display</path>
<url>/device/*/restart-display</url>
<method>POST</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Edit Sequence</name>
<path>/device-mgt/user/device/edit-sequence</path>
<url>/device/*/edit-sequence</url>
<method>POST</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Upload Content</name>
<path>/device-mgt/user/device/upload-content</path>
<url>/device/*/upload-content</url>
<method>POST</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Add Resource</name>
<path>/device-mgt/user/device/add-resource</path>
<url>/device/*/add-resource</url>
<method>POST</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Remove Resource</name>
<path>/device-mgt/user/device/remove-resource</path>
<url>/device/*/remove-resource</url>
<method>POST</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Restart Server</name>
<path>/device-mgt/user/device/restart-server</path>
<url>/device/*/restart-server</url>
<method>POST</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Take Screenshot</name>
<path>/device-mgt/user/device/screenshot</path>
<url>/device/*/screenshot</url>
<method>POST</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Get Device Stats</name>
<path>/device-mgt/user/device/get-device-status</path>
<url>/device/*/get-device-status</url>
<method>POST</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Get Content List</name>
<path>/device-mgt/user/device/get-content-list</path>
<url>/device/*/get-content-list</url>
<method>POST</method>
<scope></scope>
<scope>digital_display_user</scope>
</Permission>
</PermissionConfiguration>

@ -30,7 +30,6 @@ import java.io.File;
public class DroneAnalyzerServiceUtils {
private static final String SUPER_TENANT = "carbon.super";
private static org.apache.commons.logging.Log log = LogFactory.getLog(DroneAnalyzerServiceUtils.class);
public static void sendCommandViaXMPP(String deviceOwner, String deviceId, String resource,

@ -26,6 +26,7 @@
it will result 403 error at the runtime.
-->
<PermissionConfiguration>
<APIVersion></APIVersion>
<!-- Device related APIs -->
<Permission>
@ -33,55 +34,56 @@
<path>/device-mgt/user/devices/list</path>
<url>/devices/*</url>
<method>GET</method>
<scope></scope>
<scope>drone_analyzer_user</scope>
</Permission>
<Permission>
<name>Remove device</name>
<path>/device-mgt/user/devices/remove</path>
<url>/devices/*</url>
<method>DELETE</method>
<scope></scope>
<scope>drone_analyzer_user</scope>
</Permission>
<Permission>
<name>Download device</name>
<path>/device-mgt/user/devices/add</path>
<url>/devices/*/download</url>
<method>GET</method>
<scope></scope>
<scope>drone_analyzer_user</scope>
</Permission>
<Permission>
<name>Update device</name>
<path>/device-mgt/user/devices/update</path>
<url>/devices/*</url>
<method>POST</method>
<scope></scope>
<scope>drone_analyzer_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Get Devices</name>
<path>/device-mgt/user/devices</path>
<url>/devices</url>
<method>GET</method>
<scope></scope>
<scope>drone_analyzer_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Generate Link</name>
<path>/device-mgt/user/devices/generate_link</path>
<url>/devices/*/generate_link</url>
<method>GET</method>
<scope></scope>
<scope>drone_analyzer_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Register Device</name>
<path>/device-mgt/user/device/register</path>
<url>/device/register/*/*/*</url>
<method>POST</method>
<scope></scope>
<scope>drone_analyzer_device</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Send Command</name>
<path>/device-mgt/user/device/send_command</path>
<url>/device/*/send_command</url>
<method>POST</method>
<scope></scope>
<scope>drone_analyzer_user</scope>
</Permission>
</PermissionConfiguration>
</PermissionConfiguration>

@ -45,8 +45,6 @@ import java.util.concurrent.Future;
public class RaspberrypiServiceUtils {
private static final Log log = LogFactory.getLog(RaspberrypiServiceUtils.class);
//TODO; replace this tenant domain
private static final String SUPER_TENANT = "carbon.super";
private static final String TEMPERATURE_STREAM_DEFINITION = "org.wso2.iot.devices.temperature";
public static String sendCommandViaHTTP(final String deviceHTTPEndpoint, String urlContext,

@ -26,83 +26,85 @@
it will result 403 error at the runtime.
-->
<PermissionConfiguration>
<APIVersion></APIVersion>
<APIVersion></APIVersion>
<!-- Device related APIs -->
<Permission>
<name>Get device</name>
<path>/device-mgt/user/devices/list</path>
<url>/devices/*</url>
<method>GET</method>
<scope></scope>
<scope>raspberrypi_user</scope>
</Permission>
<Permission>
<name>Remove device</name>
<path>/device-mgt/user/devices/remove</path>
<url>/devices/*</url>
<method>DELETE</method>
<scope></scope>
<scope>raspberrypi_user</scope>
</Permission>
<Permission>
<name>Download device</name>
<path>/device-mgt/user/devices/add</path>
<url>/devices/*/download</url>
<method>GET</method>
<scope></scope>
<scope>raspberrypi_user</scope>
</Permission>
<Permission>
<name>Update device</name>
<path>/device-mgt/user/devices/update</path>
<url>/devices/*</url>
<method>POST</method>
<scope></scope>
<scope>raspberrypi_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Get Devices</name>
<path>/device-mgt/user/devices</path>
<url>/devices</url>
<method>GET</method>
<scope></scope>
<scope>raspberrypi_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Generate Link</name>
<path>/device-mgt/user/devices/generate_link</path>
<url>/devices/*/generate_link</url>
<method>GET</method>
<scope></scope>
<scope>raspberrypi_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Register Device</name>
<path>/device-mgt/user/device/register</path>
<url>/device/register/*/*/*</url>
<method>POST</method>
<scope></scope>
<scope>raspberrypi_device</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Control Bulb</name>
<path>/device-mgt/user/device/bulb</path>
<url>/device/*/bulb</url>
<method>POST</method>
<scope></scope>
<scope>raspberrypi_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Read Temperature</name>
<path>/device-mgt/user/device/readtemperature</path>
<url>/device/*/readtemperature</url>
<method>GET</method>
<scope></scope>
<scope>raspberrypi_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Push Temperature</name>
<path>/device-mgt/user/device/push_temperature</path>
<url>/device/push_temperature</url>
<method>POST</method>
<scope></scope>
<scope>raspberrypi_device</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Get Temperature Data</name>
<path>/device-mgt/user/device/sensors/temperature</path>
<url>/device/stats/*/sensors/temperature</url>
<method>GET</method>
<scope></scope>
<scope>raspberrypi_user</scope>
</Permission>
</PermissionConfiguration>

@ -33,90 +33,90 @@
<path>/device-mgt/user/devices/list</path>
<url>/devices/*</url>
<method>GET</method>
<scope></scope>
<scope>virtual_firealarm_user</scope>
</Permission>
<Permission>
<name>Remove device</name>
<path>/device-mgt/user/devices/remove</path>
<url>/devices/*</url>
<method>DELETE</method>
<scope></scope>
<scope>virtual_firealarm_user</scope>
</Permission>
<Permission>
<name>Download device</name>
<path>/device-mgt/user/devices/add</path>
<url>/devices/*/download</url>
<method>GET</method>
<scope></scope>
<scope>virtual_firealarm_user</scope>
</Permission>
<Permission>
<name>Update device</name>
<path>/device-mgt/user/devices/update</path>
<url>/devices/*</url>
<method>POST</method>
<scope></scope>
<scope>virtual_firealarm_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Get Devices</name>
<path>/device-mgt/user/devices</path>
<url>/devices</url>
<method>GET</method>
<scope></scope>
<scope>virtual_firealarm_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Generate Link</name>
<path>/device-mgt/user/devices/generate_link</path>
<url>/devices/*/generate_link</url>
<method>GET</method>
<scope></scope>
<scope>virtual_firealarm_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Register Device</name>
<path>/device-mgt/user/device/register</path>
<url>/device/register/*/*/*</url>
<method>POST</method>
<scope></scope>
<scope>virtual_firealarm_device</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Control Buzz</name>
<path>/device-mgt/user/device/buzz</path>
<url>/device/*/buzz</url>
<method>POST</method>
<scope></scope>
<scope>virtual_firealarm_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Get Temperature</name>
<path>/device-mgt/user/device/temperature</path>
<url>/device/*/temperature</url>
<method>GET</method>
<scope></scope>
<scope>virtual_firealarm_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Push Temperature</name>
<path>/device-mgt/user/device/temperature</path>
<url>/device/temperature</url>
<method>POST</method>
<scope></scope>
<scope>virtual_firealarm_device</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Get SCEP</name>
<path>/device-mgt/user/device/scep</path>
<url>/device/scep</url>
<method>GET</method>
<scope></scope>
<scope>virtual_firealarm_user</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Push SCEP</name>
<path>/device-mgt/user/device/scep</path>
<url>/device/scep</url>
<method>POST</method>
<scope></scope>
<scope>virtual_firealarm_device</scope>
</Permission>
<Permission>
<name></name>
<path></path>
<name>Get Stats</name>
<path>/device-mgt/user/device/stats</path>
<url>/device/stats/*/sensors/*</url>
<method>GET</method>
<scope></scope>
<scope>virtual_firealarm_device</scope>
</Permission>
</PermissionConfiguration>
Loading…
Cancel
Save