Commiting permission-scope mapping improvements

revert-dabc3590
Milan Perera 8 years ago
parent f864285454
commit 6ad6bbbdc0

@ -54,7 +54,7 @@ public interface AndroidSenseService {
*/
@Path("device/{deviceId}/words")
@POST
@Scope(key = "device:android-sense:enroll", name = "", description = "")
//@Scope(key = "device:android-sense:enroll", name = "", description = "")
Response sendKeyWords(@PathParam("deviceId") String deviceId, @QueryParam("keywords") String keywords);
/**
@ -65,12 +65,12 @@ public interface AndroidSenseService {
*/
@Path("device/{deviceId}/words/threshold")
@POST
@Scope(key = "device:android-sense:enroll", name = "", description = "")
//@Scope(key = "device:android-sense:enroll", name = "", description = "")
Response sendThreshold(@PathParam("deviceId") String deviceId, @QueryParam("threshold") String threshold);
@Path("device/{deviceId}/words")
@DELETE
@Scope(key = "device:android-sense:enroll", name = "", description = "")
//@Scope(key = "device:android-sense:enroll", name = "", description = "")
Response removeKeyWords(@PathParam("deviceId") String deviceId, @QueryParam("words") String words);
/**
@ -79,7 +79,7 @@ public interface AndroidSenseService {
@Path("stats/{deviceId}/sensors/{sensorName}")
@GET
@Consumes("application/json")
@Scope(key = "device:android-sense:enroll", name = "", description = "")
//@Scope(key = "device:android-sense:enroll", name = "", description = "")
@Produces("application/json")
Response getAndroidSenseDeviceStats(@PathParam("deviceId") String deviceId, @PathParam("sensorName") String sensor,
@QueryParam("from") long from, @QueryParam("to") long to);
@ -89,7 +89,7 @@ public interface AndroidSenseService {
*/
@Path("device/{device_id}/register")
@POST
@Scope(key = "device:android-sense:enroll", name = "", description = "")
//@Scope(key = "device:android-sense:enroll", name = "", description = "")
Response register(@PathParam("device_id") String deviceId, @QueryParam("deviceName") String deviceName);
}

@ -48,12 +48,12 @@ public interface ArduinoService {
@Path("device/{deviceId}/bulb")
@POST
@Scope(key = "device:arduino:enroll", name = "", description = "")
//@Scope(key = "device:arduino:enroll", name = "", description = "")
Response switchBulb(@PathParam("deviceId") String deviceId, @QueryParam("state") String state);
@Path("device/{deviceId}/controls")
@GET
@Scope(key = "device:arduino:enroll", name = "", description = "")
//@Scope(key = "device:arduino:enroll", name = "", description = "")
Response readControls(@PathParam("deviceId") String deviceId);
/**
@ -63,7 +63,7 @@ public interface ArduinoService {
@GET
@Consumes("application/json")
@Produces("application/json")
@Scope(key = "device:arduino:enroll", name = "", description = "")
//@Scope(key = "device:arduino:enroll", name = "", description = "")
Response getArduinoTemperatureStats(@PathParam("deviceId") String deviceId, @QueryParam("from") long from,
@QueryParam("to") long to);
@ -73,7 +73,7 @@ public interface ArduinoService {
@Path("device/download")
@GET
@Produces("application/octet-stream")
@Scope(key = "device:arduino:enroll", name = "", description = "")
//@Scope(key = "device:arduino:enroll", name = "", description = "")
Response downloadSketch(@QueryParam("deviceName") String customDeviceName);
}

@ -48,7 +48,7 @@ public interface RaspberryPiService {
@Path("device/{deviceId}/bulb")
@POST
@Scope(key = "device:raspberrypi:enroll", name = "", description = "")
//@Scope(key = "device:raspberrypi:enroll", name = "", description = "")
Response switchBulb(@PathParam("deviceId") String deviceId, @QueryParam("state") String state);
/**
@ -58,7 +58,7 @@ public interface RaspberryPiService {
@GET
@Consumes("application/json")
@Produces("application/json")
@Scope(key = "device:raspberrypi:enroll", name = "", description = "")
//@Scope(key = "device:raspberrypi:enroll", name = "", description = "")
Response getRaspberryPiTemperatureStats(@PathParam("deviceId") String deviceId,
@QueryParam("from") long from, @QueryParam("to") long to);
@ -68,7 +68,7 @@ public interface RaspberryPiService {
@Path("device/download")
@GET
@Produces(MediaType.APPLICATION_JSON)
@Scope(key = "device:raspberrypi:enroll", name = "", description = "")
//@Scope(key = "device:raspberrypi:enroll", name = "", description = "")
Response downloadSketch(@QueryParam("deviceName") String deviceName, @QueryParam("sketch_type") String sketchType);
}

@ -63,7 +63,7 @@ public interface VirtualFireAlarmService {
*/
@POST
@Path("device/{deviceId}/buzz")
@Scope(key = "device:firealarm:enroll", name = "", description = "")
//@Scope(key = "device:firealarm:enroll", name = "", description = "")
Response switchBuzzer(@PathParam("deviceId") String deviceId,
@FormParam("state") String state);
@ -72,7 +72,7 @@ public interface VirtualFireAlarmService {
*/
@Path("device/stats/{deviceId}")
@GET
@Scope(key = "device:firealarm:enroll", name = "", description = "")
//@Scope(key = "device:firealarm:enroll", name = "", description = "")
@Consumes("application/json")
@Produces("application/json")
Response getVirtualFirealarmStats(@PathParam("deviceId") String deviceId, @QueryParam("from") long from,
@ -81,7 +81,7 @@ public interface VirtualFireAlarmService {
@Path("device/download")
@GET
@Produces("application/zip")
@Scope(key = "device:firealarm:enroll", name = "", description = "")
//@Scope(key = "device:firealarm:enroll", name = "", description = "")
Response downloadSketch(@QueryParam("deviceName") String deviceName, @QueryParam("sketchType") String sketchType);
}

@ -24,7 +24,6 @@ import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import io.swagger.annotations.Api;
import org.wso2.carbon.apimgt.annotations.api.Permission;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException;
import javax.jws.WebService;
@ -68,31 +67,32 @@ public interface DeviceManagementAdminService {
@POST
@Path("/lock-devices")
@Permission(name = "Lock Device", permission = "/device-mgt/devices/owning-device/operations/windows/lock")
//@Permission(name = "Lock Device", permission = "/device-mgt/devices/owning-device/operations/windows/lock")
Response lock(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws
WindowsDeviceEnrolmentException;
@POST
@Path("/disenroll-devices")
@Permission(name = "Disenroll Device", permission = "/device-mgt/devices/disenroll/windows")
//@Permission(name = "Disenroll Device", permission = "/device-mgt/devices/disenroll/windows")
Response disenroll(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws
WindowsDeviceEnrolmentException;
@POST
@Path("/wipe-devices")
@Permission(name = "Wipe Device", permission = "/device-mgt/devices/owning-device/operations/windows/wipe")
//@Permission(name = "Wipe Device", permission = "/device-mgt/devices/owning-device/operations/windows/wipe")
Response wipe(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws
WindowsDeviceEnrolmentException;
@POST
@Path("/ring-devices")
@Permission(name = "Ring Device", permission = "/device-mgt/devices/owning-device/operations/windows/ring")
//@Permission(name = "Ring Device", permission = "/device-mgt/devices/owning-device/operations/windows/ring")
Response ring(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws
WindowsDeviceEnrolmentException;
@POST
@Path("/lock-reset-devices")
@Permission(name = "Lock-Reset Device", permission = "/device-mgt/devices/owning-device/operations/windows/lock-reset")
//@Permission(name = "Lock-Reset Device", permission =
// "/device-mgt/devices/owning-device/operations/windows/lock-reset")
Response lockReset(@HeaderParam("Accept") String acceptHeader, List<String> deviceIds)
throws WindowsDeviceEnrolmentException;
}

@ -18,7 +18,6 @@
package org.wso2.carbon.device.mgt.mobile.windows.api.services.authbst;
import org.wso2.carbon.apimgt.annotations.api.Permission;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.authbst.beans.Credentials;
@ -37,6 +36,6 @@ public interface BSTProvider {
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("/authentication")
@Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/windows")
// @Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/windows")
Response getBST(Credentials credentials) throws WindowsDeviceEnrolmentException;
}

Loading…
Cancel
Save