From 2e79dd290e01327d5e48e94d4c406107b8053c11 Mon Sep 17 00:00:00 2001 From: mharindu Date: Mon, 8 Aug 2016 18:24:44 +0530 Subject: [PATCH] Modified scopes --- .../api/CertificateManagementAdminService.java | 8 ++++---- .../api/ActivityInfoProviderService.java | 4 ++-- .../api/ConfigurationManagementService.java | 2 +- .../service/api/DeviceManagementService.java | 16 ++++++++-------- .../api/NotificationManagementService.java | 4 ++-- .../service/api/PolicyManagementService.java | 18 +++++++++--------- .../service/api/RoleManagementService.java | 16 ++++++++-------- .../service/api/UserManagementService.java | 18 +++++++++--------- .../admin/DeviceManagementAdminService.java | 2 +- .../api/admin/DeviceTypeManagementService.java | 2 +- 10 files changed, 45 insertions(+), 45 deletions(-) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/CertificateManagementAdminService.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/CertificateManagementAdminService.java index 226cc53710..da1d54bc4f 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/CertificateManagementAdminService.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/CertificateManagementAdminService.java @@ -77,7 +77,7 @@ public interface CertificateManagementAdminService { message = "Internal Server Error. \n Server error occurred while adding certificates.", response = ErrorResponse.class) }) - @Scope(key = "certificate:write", name = "Add certificates", description = "") + @Scope(key = "certificate:manage", name = "Add certificates", description = "") Response addCertificate( @ApiParam( name = "enrollmentCertificates", @@ -135,7 +135,7 @@ public interface CertificateManagementAdminService { "Server error occurred while retrieving information requested certificate.", response = ErrorResponse.class) }) - @Scope(key = "certificate:read", name = "View certificates", description = "") + @Scope(key = "certificate:view", name = "View certificates", description = "") Response getCertificate( @ApiParam(name = "serialNumber", value = "Provide the serial number of the certificate that you wish to get the details of", @@ -207,7 +207,7 @@ public interface CertificateManagementAdminService { "Server error occurred while retrieving all certificates enrolled in the system.", response = ErrorResponse.class) }) - @Scope(key = "certificate:read", name = "View certificates", description = "") + @Scope(key = "certificate:view", name = "View certificates", description = "") Response getAllCertificates( @ApiParam( name = "offset", @@ -250,7 +250,7 @@ public interface CertificateManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while removing the certificate.", response = ErrorResponse.class)}) - @Scope(key = "certificate:write", name = "Add certificates", description = "") + @Scope(key = "certificate:manage", name = "Add certificates", description = "") Response removeCertificate( @ApiParam( name = "serialNumber", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java index e01511c93e..50f596be47 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java @@ -91,7 +91,7 @@ public interface ActivityInfoProviderService { message = "Internal Server Error. \n Server error occurred while fetching activity data.", response = ErrorResponse.class) }) - @Scope(key = "activity:read", name = "View Activities", description = "") + @Scope(key = "activity:view", name = "View Activities", description = "") Response getActivity( @ApiParam( name = "id", @@ -150,7 +150,7 @@ public interface ActivityInfoProviderService { message = "Internal Server Error. \n Server error occurred while fetching activity data.", response = ErrorResponse.class) }) - @Scope(key = "activity:read", name = "View Activities", description = "") + @Scope(key = "activity:view", name = "View Activities", description = "") Response getActivities( @ApiParam( name = "since", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java index d6a2b3bad9..3708677b75 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java @@ -81,7 +81,7 @@ public interface ConfigurationManagementService { "platform configuration.", response = ErrorResponse.class) }) - @Scope(key = "configuration:read", name = "View Configurations", description = "") + @Scope(key = "configuration:view", name = "View Configurations", description = "") Response getConfiguration( @ApiParam( name = "If-Modified-Since", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index 19bc4be795..35d97cc48e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -91,7 +91,7 @@ public interface DeviceManagementService { message = "Internal Server Error. \n Server error occurred while fetching the device list.", response = ErrorResponse.class) }) - @Scope(key = "device:read", name = "View Devices", description = "") + @Scope(key = "device:view", name = "View Devices", description = "") Response getDevices( @ApiParam( name = "name", @@ -200,7 +200,7 @@ public interface DeviceManagementService { "Server error occurred while retrieving information requested device.", response = ErrorResponse.class) }) - @Scope(key = "device:read", name = "View Devices", description = "") + @Scope(key = "device:view", name = "View Devices", description = "") Response getDevice( @ApiParam( name = "type", @@ -280,7 +280,7 @@ public interface DeviceManagementService { "Server error occurred while retrieving feature list of the device.", response = ErrorResponse.class) }) - @Scope(key = "device:read", name = "View Devices", description = "") + @Scope(key = "device:view", name = "View Devices", description = "") Response getFeaturesOfDevice( @ApiParam( name = "type", @@ -354,7 +354,7 @@ public interface DeviceManagementService { "Server error occurred while enrolling the device.", response = ErrorResponse.class) }) - @Scope(key = "device:read", name = "View Devices", description = "") + @Scope(key = "device:view", name = "View Devices", description = "") Response searchDevices( @ApiParam( name = "offset", @@ -433,7 +433,7 @@ public interface DeviceManagementService { "Server error occurred while retrieving installed application list of the device.", response = ErrorResponse.class) }) - @Scope(key = "device:read", name = "View Devices", description = "") + @Scope(key = "device:view", name = "View Devices", description = "") Response getInstalledApplications( @ApiParam( name = "type", @@ -527,7 +527,7 @@ public interface DeviceManagementService { "Server error occurred while retrieving operation list scheduled for the device.", response = ErrorResponse.class) }) - @Scope(key = "device:read", name = "View Devices", description = "") + @Scope(key = "device:view", name = "View Devices", description = "") Response getDeviceOperations( @ApiParam( name = "type", @@ -623,7 +623,7 @@ public interface DeviceManagementService { response = ErrorResponse.class) } ) - @Scope(key = "device:read", name = "View Devices", description = "") + @Scope(key = "device:view", name = "View Devices", description = "") Response getEffectivePolicyOfDevice( @ApiParam( name = "type", @@ -674,7 +674,7 @@ public interface DeviceManagementService { response = ErrorResponse.class) } ) - @Scope(key = "device:read", name = "View Devices", description = "") + @Scope(key = "device:view", name = "View Devices", description = "") Response getComplianceDataOfDevice( @ApiParam( name = "type", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java index f479b310c9..181c2e5983 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java @@ -88,7 +88,7 @@ public interface NotificationManagementService { "\n Server error occurred while fetching the notification list.", response = ErrorResponse.class) }) - @Scope(key = "notification:read", name = "View and manage notifications", description = "") + @Scope(key = "notification:view", name = "View and manage notifications", description = "") Response getNotifications( @ApiParam( name = "status", @@ -140,7 +140,7 @@ public interface NotificationManagementService { message = "Error occurred while updating notification status.") } ) - @Scope(key = "notification:read", name = "View and manage notifications", description = "") + @Scope(key = "notification:view", name = "View and manage notifications", description = "") Response updateNotificationStatus( @ApiParam( name = "id", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java index f75857e6f8..00175e3ca9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java @@ -99,7 +99,7 @@ public interface PolicyManagementService { "Server error occurred while adding a new policy.", response = ErrorResponse.class) }) - @Scope(key = "policy:write", name = "Add policies", description = "") + @Scope(key = "policy:manage", name = "Add policies", description = "") Response addPolicy( @ApiParam( name = "policy", @@ -153,7 +153,7 @@ public interface PolicyManagementService { "policies."), response = ErrorResponse.class) }) - @Scope(key = "policy:read", name = "Views policies", description = "") + @Scope(key = "policy:view", name = "Views policies", description = "") Response getPolicies( @ApiParam( name = "If-Modified-Since", @@ -219,7 +219,7 @@ public interface PolicyManagementService { "policy.", response = ErrorResponse.class) }) - @Scope(key = "policy:read", name = "View policies", description = "") + @Scope(key = "policy:view", name = "View policies", description = "") Response getPolicy( @ApiParam( name = "id", @@ -283,7 +283,7 @@ public interface PolicyManagementService { "Server error occurred while updating the policy.", response = ErrorResponse.class) }) - @Scope(key = "policy:write", name = "Add policies", description = "") + @Scope(key = "policy:manage", name = "Add policies", description = "") Response updatePolicy( @ApiParam( name = "id", @@ -329,7 +329,7 @@ public interface PolicyManagementService { "Server error occurred while bulk removing policies.", response = ErrorResponse.class) }) - @Scope(key = "policy:write", name = "Add policies", description = "") + @Scope(key = "policy:manage", name = "Add policies", description = "") Response removePolicies( @ApiParam( name = "policyIds", @@ -365,7 +365,7 @@ public interface PolicyManagementService { message = "ErrorResponse in activating policies.", response = ErrorResponse.class) }) - @Scope(key = "policy:write", name = "Add policies", description = "") + @Scope(key = "policy:manage", name = "Add policies", description = "") Response activatePolicies( @ApiParam( name = "policyIds", @@ -401,7 +401,7 @@ public interface PolicyManagementService { message = "ErrorResponse in deactivating policies.", response = ErrorResponse.class) }) - @Scope(key = "policy:write", name = "Add policies", description = "") + @Scope(key = "policy:manage", name = "Add policies", description = "") Response deactivatePolicies( @ApiParam( name = "policyIds", @@ -434,7 +434,7 @@ public interface PolicyManagementService { message = "ErrorResponse in deactivating policies.", response = ErrorResponse.class) }) - @Scope(key = "policy:write", name = "Add policies", description = "") + @Scope(key = "policy:manage", name = "Add policies", description = "") Response applyChanges(); @@ -463,7 +463,7 @@ public interface PolicyManagementService { message = "Exception in updating policy priorities.", response = ErrorResponse.class) }) - @Scope(key = "policy:write", name = "Add policies", description = "") + @Scope(key = "policy:manage", name = "Add policies", description = "") Response updatePolicyPriorities( @ApiParam( name = "priorityUpdatedPolicies", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RoleManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RoleManagementService.java index 73fcb77bb2..83b8e5851f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RoleManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RoleManagementService.java @@ -76,7 +76,7 @@ public interface RoleManagementService { message = "Internal Server Error. \n Server error occurred while fetching requested list of roles.", response = ErrorResponse.class) }) - @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:read", name = "View roles", description = "") + @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:view", name = "View roles", description = "") Response getRoles( @ApiParam( name = "filter", @@ -158,7 +158,7 @@ public interface RoleManagementService { message = "Internal Server ErrorResponse. \n Server error occurred while fetching the permission list of the requested role.", response = ErrorResponse.class) }) - @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:read", name = "View roles", description = "") + @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:view", name = "View roles", description = "") Response getScopes( @ApiParam( name = "If-Modified-Since", @@ -208,7 +208,7 @@ public interface RoleManagementService { message = "Internal Server Error. \n Server error occurred while updating the scopes.", response = ErrorResponse.class) }) - @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:add", name = "Add roles", description = "") + @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:manage", name = "Add roles", description = "") Response updateScopes( @ApiParam( name = "Scopes", @@ -265,7 +265,7 @@ public interface RoleManagementService { "requested role.", response = ErrorResponse.class) }) - @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:read", name = "View roles", description = "") + @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:view", name = "View roles", description = "") Response getRole( @ApiParam( name = "roleName", @@ -325,7 +325,7 @@ public interface RoleManagementService { message = "Internal Server Error. \n Server error occurred while adding a new role.", response = ErrorResponse.class) }) - @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:add", name = "Add roles", description = "") + @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:manage", name = "Add roles", description = "") Response addRole( @ApiParam( name = "role", @@ -375,7 +375,7 @@ public interface RoleManagementService { message = "Internal Server Error. \n Server error occurred while updating the role.", response = ErrorResponse.class) }) - @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:add", name = "Add roles", description = "") + @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:manage", name = "Add roles", description = "") Response updateRole( @ApiParam( name = "roleName", @@ -412,7 +412,7 @@ public interface RoleManagementService { message = "Internal Server Error. \n Server error occurred while removing the role.", response = ErrorResponse.class) }) - @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:add", name = "Add roles", description = "") + @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:manage", name = "Add roles", description = "") Response deleteRole( @ApiParam( name = "roleName", @@ -474,7 +474,7 @@ public interface RoleManagementService { "Server error occurred while updating the user list of the role.", response = ErrorResponse.class) }) - @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:add", name = "Add roles", description = "") + @org.wso2.carbon.apimgt.annotations.api.Scope(key = "role:manage", name = "Add roles", description = "") Response updateUsersOfRole( @ApiParam( name = "roleName", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java index d90cc14b7b..27fdf848e0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java @@ -83,7 +83,7 @@ public interface UserManagementService { message = "Internal Server Error. \n Server error occurred while adding a new user.", response = ErrorResponse.class) }) - @Scope(key = "user:write", name = "Add users", description = "") + @Scope(key = "user:manage", name = "Add users", description = "") Response addUser( @ApiParam( name = "user", @@ -135,7 +135,7 @@ public interface UserManagementService { " fetching the requested user.", response = ErrorResponse.class) }) - @Scope(key = "user:read", name = "View users", description = "") + @Scope(key = "user:view", name = "View users", description = "") Response getUser( @ApiParam( name = "username", @@ -192,7 +192,7 @@ public interface UserManagementService { "Server error occurred while updating the user.", response = ErrorResponse.class) }) - @Scope(key = "user:write", name = "Add users", description = "") + @Scope(key = "user:manage", name = "Add users", description = "") Response updateUser( @ApiParam( name = "username", @@ -227,7 +227,7 @@ public interface UserManagementService { response = ErrorResponse.class ) }) - @Scope(key = "user:write", name = "Add users", description = "") + @Scope(key = "user:manage", name = "Add users", description = "") Response removeUser( @ApiParam(name = "username", value = "Username of the user to be deleted.", required = true) @PathParam("username") String username); @@ -276,7 +276,7 @@ public interface UserManagementService { " assigned to the user.", response = ErrorResponse.class) }) - @Scope(key = "user:read", name = "View users", description = "") + @Scope(key = "user:view", name = "View users", description = "") Response getRolesOfUser( @ApiParam(name = "username", value = "Username of the user.", required = true) @PathParam("username") String username); @@ -319,7 +319,7 @@ public interface UserManagementService { message = "Internal Server Error. \n Server error occurred while fetching the user list.", response = ErrorResponse.class) }) - @Scope(key = "user:read", name = "View users", description = "") + @Scope(key = "user:view", name = "View users", description = "") Response getUsers( @ApiParam( name = "filter", @@ -386,7 +386,7 @@ public interface UserManagementService { "list that matches the given filter.", response = ErrorResponse.class) }) - @Scope(key = "user:read", name = "View users", description = "") + @Scope(key = "user:view", name = "View users", description = "") Response getUserNames( @ApiParam( name = "filter", @@ -440,7 +440,7 @@ public interface UserManagementService { "Server error occurred while updating credentials of the user.", response = ErrorResponse.class) }) - @Scope(key = "user:read", name = "View users", description = "") + @Scope(key = "user:view", name = "View users", description = "") Response resetPassword( @ApiParam( name = "username", @@ -483,7 +483,7 @@ public interface UserManagementService { "Server error occurred while updating credentials of the user.", response = ErrorResponse.class) }) - @Scope(key = "user:write", name = "Add users", description = "") + @Scope(key = "user:manage", name = "Add users", description = "") Response inviteExistingUsersToEnrollDevice( @ApiParam( name = "users", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java index e90e346eeb..266357366e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java @@ -84,7 +84,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n Server error occurred while fetching the device list.", response = ErrorResponse.class) }) - @Scope(key = "device:admin:read", name = "View Devices", description = "") + @Scope(key = "device:admin:view", name = "View Devices", description = "") Response getDevicesByName( @ApiParam( name = "name", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementService.java index 39970a7e5d..4212f65ceb 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementService.java @@ -78,7 +78,7 @@ public interface DeviceTypeManagementService { response = ErrorResponse.class) } ) - @Scope(key = "device-type:admin:read", name = "View device types", description = "") + @Scope(key = "device-type:admin:view", name = "View device types", description = "") Response getDeviceTypes( @ApiParam( name = "If-Modified-Since",