adding permissions for DM services

merge-requests/7/head
inoshperera 9 years ago
parent 0b9c64594c
commit 1ffbb2183a

@ -42,17 +42,16 @@ public interface ActivityInfoProviderService {
@ApiOperation( @ApiOperation(
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "GET",
value = "Retrieving the operation details.", value = "Retrieving the operation details.",
notes = "This will return the operation details including the responses from the devices.") notes = "This will return the operation details including the responses from the devices.")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(code = 200, message = "Activity details provided successfully."), @ApiResponse(code = 200, message = "Activity details provided successfully."),
@ApiResponse(code = 500, message = "Error occurred while fetching the activity for the supplied id.") @ApiResponse(code = 500, message = "Error occurred while fetching the activity for the supplied id.")
}) })
@Permission(scope = "operation-view", permissions = {"/permission/admin/device-mgt/admin/devices/view"}) @Permission(scope = "activity-view", permissions = {"/permission/admin/device-mgt/admin/activities/view"})
Response getActivity( Response getActivity(
@ApiParam(name = "id", value = "Activity id of the operation/activity to be retrieved.", @ApiParam(name = "id", value = "Activity id of the operation/activity to be retrieved.", required = true)
required = true)
@PathParam("id") String id); @PathParam("id") String id);
} }

@ -55,8 +55,8 @@ public interface DeviceManagementService {
response = org.wso2.carbon.device.mgt.common.Device.class, response = org.wso2.carbon.device.mgt.common.Device.class,
responseContainer = "List") responseContainer = "List")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(code = 200, message = "Successfully fetched the list of devices.", response = org.wso2.carbon @ApiResponse(code = 200, message = "Successfully fetched the list of devices.",
.device.mgt.common.Device.class, responseContainer = "List"), response = org.wso2.carbon.device.mgt.common.Device.class, responseContainer = "List"),
@ApiResponse(code = 404, message = "No device has currently been under the provided type."), @ApiResponse(code = 404, message = "No device has currently been under the provided type."),
@ApiResponse(code = 500, message = "Error occurred while fetching the device list.") @ApiResponse(code = 500, message = "Error occurred while fetching the device list.")
}) })
@ -68,8 +68,14 @@ public interface DeviceManagementService {
"index.", required = true) "index.", required = true)
@QueryParam("limit") int limit); @QueryParam("limit") int limit);
Response getDevices(@HeaderParam("If-Modified-Since") Date timestamp, @QueryParam("offset") int offset, Response getDevices(
@QueryParam("limit") int limit); @ApiParam(name = "If-Modified-Since", value = "Time since the device information changed.")
@HeaderParam("If-Modified-Since") Date timestamp,
@ApiParam(name = "offset", value = "Starting pagination index.",required = true)
@QueryParam("offset") int offset,
@ApiParam(name = "limit", value = "How many device details are required from the starting pagination " +
"index.", required = true)
@QueryParam("limit") int limit);
@GET @GET
@ApiOperation( @ApiOperation(

@ -29,7 +29,98 @@
--> -->
<PermissionConfiguration> <PermissionConfiguration>
<APIVersion></APIVersion> <APIVersion></APIVersion>
<!-- Activity related APIs -->
<Permission>
<name>Fetch Activity related details</name>
<path>/device-mgt/admin/activities/view</path>
<url>/activities/*</url>
<method>GET</method>
</Permission>
<!-- Activity related APIs -->
<!-- Device related APIs --> <!-- Device related APIs -->
<Permission>
<name>List devices</name>
<path>/device-mgt/admin/devices/list</path>
<url>/devices</url>
<method>GET</method>
</Permission>
<Permission>
<name>List device types</name>
<path>/device-mgt/admin/devices/list</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>List device types</name>
<path>/device-mgt/user/devices/list</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Add policy</name>
<path>/device-mgt/admin/policies/add</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Add User policy</name>
<path>/device-mgt/user/policies/add</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Edit policy</name>
<path>/device-mgt/admin/policies/update</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Edit User policy</name>
<path>/device-mgt/user/policies/update</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>View device</name>
<path>/device-mgt/admin/devices/view</path>
<url>/devices/view</url>
<method>GET</method>
</Permission>
<Permission>
<name>View user device</name>
<path>/device-mgt/user/devices/view</path>
<url>/devices/view</url>
<method>GET</method>
</Permission>
<Permission>
<name>Modify user device</name>
<path>/device-mgt/user/devices/update</path>
<url>/devices/type/*/id/*</url>
<method>PUT</method>
</Permission>
<Permission>
<name>Remove user device</name>
<path>/device-mgt/user/devices/remove</path>
<url>/devices/type/*/id/*</url>
<method>DELETE</method>
</Permission>
<Permission> <Permission>
<name>Device Management</name> <name>Device Management</name>
@ -143,82 +234,7 @@
<method>GET</method> <method>GET</method>
</Permission> </Permission>
<Permission>
<name>List devices</name>
<path>/device-mgt/admin/devices/list</path>
<url>/devices</url>
<method>GET</method>
</Permission>
<Permission>
<name>List device types</name>
<path>/device-mgt/admin/devices/list</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>List device types</name>
<path>/device-mgt/user/devices/list</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Add policy</name>
<path>/device-mgt/admin/policies/add</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Add User policy</name>
<path>/device-mgt/user/policies/add</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Edit policy</name>
<path>/device-mgt/admin/policies/update</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Edit User policy</name>
<path>/device-mgt/user/policies/update</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>View device</name>
<path>/device-mgt/admin/devices/view</path>
<url>/devices/view</url>
<method>GET</method>
</Permission>
<Permission>
<name>View user device</name>
<path>/device-mgt/user/devices/view</path>
<url>/devices/view</url>
<method>GET</method>
</Permission>
<Permission>
<name>Modify user device</name>
<path>/device-mgt/user/devices/update</path>
<url>/devices/type/*/id/*</url>
<method>PUT</method>
</Permission>
<Permission>
<name>Remove user device</name>
<path>/device-mgt/user/devices/remove</path>
<url>/devices/type/*/id/*</url>
<method>DELETE</method>
</Permission>
<!--<Permission>--> <!--<Permission>-->
<!--<name>Get device</name>--> <!--<name>Get device</name>-->

Loading…
Cancel
Save