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

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

@ -48,7 +48,7 @@ public interface RaspberryPiService {
@Path("device/{deviceId}/bulb") @Path("device/{deviceId}/bulb")
@POST @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); Response switchBulb(@PathParam("deviceId") String deviceId, @QueryParam("state") String state);
/** /**
@ -58,7 +58,7 @@ public interface RaspberryPiService {
@GET @GET
@Consumes("application/json") @Consumes("application/json")
@Produces("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, Response getRaspberryPiTemperatureStats(@PathParam("deviceId") String deviceId,
@QueryParam("from") long from, @QueryParam("to") long to); @QueryParam("from") long from, @QueryParam("to") long to);
@ -68,7 +68,7 @@ public interface RaspberryPiService {
@Path("device/download") @Path("device/download")
@GET @GET
@Produces(MediaType.APPLICATION_JSON) @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); Response downloadSketch(@QueryParam("deviceName") String deviceName, @QueryParam("sketch_type") String sketchType);
} }

@ -63,7 +63,7 @@ public interface VirtualFireAlarmService {
*/ */
@POST @POST
@Path("device/{deviceId}/buzz") @Path("device/{deviceId}/buzz")
@Scope(key = "device:firealarm:enroll", name = "", description = "") //@Scope(key = "device:firealarm:enroll", name = "", description = "")
Response switchBuzzer(@PathParam("deviceId") String deviceId, Response switchBuzzer(@PathParam("deviceId") String deviceId,
@FormParam("state") String state); @FormParam("state") String state);
@ -72,7 +72,7 @@ public interface VirtualFireAlarmService {
*/ */
@Path("device/stats/{deviceId}") @Path("device/stats/{deviceId}")
@GET @GET
@Scope(key = "device:firealarm:enroll", name = "", description = "") //@Scope(key = "device:firealarm:enroll", name = "", description = "")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
Response getVirtualFirealarmStats(@PathParam("deviceId") String deviceId, @QueryParam("from") long from, Response getVirtualFirealarmStats(@PathParam("deviceId") String deviceId, @QueryParam("from") long from,
@ -81,7 +81,7 @@ public interface VirtualFireAlarmService {
@Path("device/download") @Path("device/download")
@GET @GET
@Produces("application/zip") @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); 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.Extension;
import io.swagger.annotations.Tag; import io.swagger.annotations.Tag;
import io.swagger.annotations.Api; 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 org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException;
import javax.jws.WebService; import javax.jws.WebService;
@ -68,31 +67,32 @@ public interface DeviceManagementAdminService {
@POST @POST
@Path("/lock-devices") @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 Response lock(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws
WindowsDeviceEnrolmentException; WindowsDeviceEnrolmentException;
@POST @POST
@Path("/disenroll-devices") @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 Response disenroll(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws
WindowsDeviceEnrolmentException; WindowsDeviceEnrolmentException;
@POST @POST
@Path("/wipe-devices") @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 Response wipe(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws
WindowsDeviceEnrolmentException; WindowsDeviceEnrolmentException;
@POST @POST
@Path("/ring-devices") @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 Response ring(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws
WindowsDeviceEnrolmentException; WindowsDeviceEnrolmentException;
@POST @POST
@Path("/lock-reset-devices") @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) Response lockReset(@HeaderParam("Accept") String acceptHeader, List<String> deviceIds)
throws WindowsDeviceEnrolmentException; throws WindowsDeviceEnrolmentException;
} }

@ -18,7 +18,6 @@
package org.wso2.carbon.device.mgt.mobile.windows.api.services.authbst; 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.common.exceptions.WindowsDeviceEnrolmentException;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.authbst.beans.Credentials; import org.wso2.carbon.device.mgt.mobile.windows.api.services.authbst.beans.Credentials;
@ -37,6 +36,6 @@ public interface BSTProvider {
@POST @POST
@Consumes(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON)
@Path("/authentication") @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; Response getBST(Credentials credentials) throws WindowsDeviceEnrolmentException;
} }

Loading…
Cancel
Save