Refactored scopes

revert-70aa11f8
mharindu 8 years ago
parent ac75ff1d71
commit fe28bc25f1

@ -91,7 +91,7 @@ public interface ActivityInfoProviderService {
message = "Internal Server Error. \n Server error occurred while fetching activity data.", message = "Internal Server Error. \n Server error occurred while fetching activity data.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "activity-view", roles = {"emm-user", "emm-admin"}) @Permission(scope = "activity:view", roles = {"admin"})
Response getActivity( Response getActivity(
@ApiParam( @ApiParam(
name = "id", name = "id",
@ -150,7 +150,7 @@ public interface ActivityInfoProviderService {
message = "Internal Server Error. \n Server error occurred while fetching activity data.", message = "Internal Server Error. \n Server error occurred while fetching activity data.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "activity-view", roles = {"emm-admin"}) @Permission(scope = "activity:view", roles = {"admin"})
Response getActivities( Response getActivities(
@ApiParam( @ApiParam(
name = "since", name = "since",

@ -81,7 +81,7 @@ public interface ConfigurationManagementService {
"platform configuration.", "platform configuration.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "configuration-view", roles = {"emm-admin"}) @Permission(scope = "configuration:view", roles = {"admin"})
Response getConfiguration( Response getConfiguration(
@ApiParam( @ApiParam(
name = "If-Modified-Since", name = "If-Modified-Since",
@ -127,7 +127,7 @@ public interface ConfigurationManagementService {
"Server error occurred while modifying general platform configuration.", "Server error occurred while modifying general platform configuration.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "configuration-modify", roles = {"emm-admin"}) @Permission(scope = "configuration:modify", roles = {"admin"})
Response updateConfiguration( Response updateConfiguration(
@ApiParam( @ApiParam(
name = "configuration", name = "configuration",

@ -90,7 +90,7 @@ public interface DeviceManagementService {
message = "Internal Server Error. \n Server error occurred while fetching the device list.", message = "Internal Server Error. \n Server error occurred while fetching the device list.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "device-list", roles = {"emm-admin"}) @Permission(scope = "device:list", roles = {"admin"})
Response getDevices( Response getDevices(
@ApiParam( @ApiParam(
name = "type", name = "type",
@ -194,7 +194,7 @@ public interface DeviceManagementService {
"Server error occurred while retrieving information requested device.", "Server error occurred while retrieving information requested device.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "device-view", roles = {"emm-admin"}) @Permission(scope = "device:view", roles = {"admin"})
Response getDevice( Response getDevice(
@ApiParam( @ApiParam(
name = "type", name = "type",
@ -274,7 +274,7 @@ public interface DeviceManagementService {
"Server error occurred while retrieving feature list of the device.", "Server error occurred while retrieving feature list of the device.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "device-search", roles = {"emm-admin"}) @Permission(scope = "device:view", roles = {"admin"})
Response getFeaturesOfDevice( Response getFeaturesOfDevice(
@ApiParam( @ApiParam(
name = "type", name = "type",
@ -348,7 +348,7 @@ public interface DeviceManagementService {
"Server error occurred while enrolling the device.", "Server error occurred while enrolling the device.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "device-search", roles = {"emm-admin" }) @Permission(scope = "device:search", roles = {"admin" })
Response searchDevices( Response searchDevices(
@ApiParam( @ApiParam(
name = "offset", name = "offset",
@ -427,7 +427,7 @@ public interface DeviceManagementService {
"Server error occurred while retrieving installed application list of the device.", "Server error occurred while retrieving installed application list of the device.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "operation-view", roles = {"emm-admin"}) @Permission(scope = "device:view", roles = {"admin"})
Response getInstalledApplications( Response getInstalledApplications(
@ApiParam( @ApiParam(
name = "type", name = "type",
@ -521,7 +521,7 @@ public interface DeviceManagementService {
"Server error occurred while retrieving operation list scheduled for the device.", "Server error occurred while retrieving operation list scheduled for the device.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "operation-view", roles = {"emm-admin"}) @Permission(scope = "device:view", roles = {"admin"})
Response getDeviceOperations( Response getDeviceOperations(
@ApiParam( @ApiParam(
name = "type", name = "type",
@ -617,7 +617,7 @@ public interface DeviceManagementService {
response = ErrorResponse.class) response = ErrorResponse.class)
} }
) )
@Permission(scope = "operation-view", roles = {"emm-admin"}) @Permission(scope = "device:view", roles = {"admin"})
Response getEffectivePolicyOfDevice( Response getEffectivePolicyOfDevice(
@ApiParam( @ApiParam(
name = "type", name = "type",
@ -639,25 +639,4 @@ public interface DeviceManagementService {
@HeaderParam("If-Modified-Since") @HeaderParam("If-Modified-Since")
String ifModifiedSince); String ifModifiedSince);
@GET
@Path("/types")
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
httpMethod = "GET",
value = "Get the device type.",
notes = "You are able to register Android, iOS and Windows devices with WSO2 EMM. In order to"
+ "retrieve the device type details that are registered this end-point van be used.",
tags = "Device Management")
@ApiResponses(
value = {
@ApiResponse(
code = 200,
message = "OK. \n Registered device types have successfully retrieved"),
@ApiResponse(
code = 500,
message = "Error occurred while fetching the list of device types.")
}
)
@Permission(scope = "operation-view", roles = {"emm-admin"})
Response getDeviceTypes();
} }

@ -90,7 +90,7 @@ public interface NotificationManagementService {
"\n Server error occurred while fetching the notification list.", "\n Server error occurred while fetching the notification list.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "device-notification-view", roles = {"emm-admin"}) @Permission(scope = "notification:view", roles = {"admin"})
Response getNotifications( Response getNotifications(
@ApiParam( @ApiParam(
name = "status", name = "status",

@ -99,7 +99,7 @@ public interface PolicyManagementService {
"Server error occurred while adding a new policy.", "Server error occurred while adding a new policy.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "policy-modify", roles = {"emm-admin"}) @Permission(scope = "policy:add", roles = {"admin"})
Response addPolicy( Response addPolicy(
@ApiParam( @ApiParam(
name = "policy", name = "policy",
@ -153,7 +153,7 @@ public interface PolicyManagementService {
"policies."), "policies."),
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "policy-view", roles = {"emm-admin"}) @Permission(scope = "policy:list", roles = {"admin"})
Response getPolicies( Response getPolicies(
@ApiParam( @ApiParam(
name = "If-Modified-Since", name = "If-Modified-Since",
@ -219,7 +219,7 @@ public interface PolicyManagementService {
"policy.", "policy.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "policy-view", roles = {"emm-admin"}) @Permission(scope = "policy:view", roles = {"admin"})
Response getPolicy( Response getPolicy(
@ApiParam( @ApiParam(
name = "id", name = "id",
@ -283,7 +283,7 @@ public interface PolicyManagementService {
"Server error occurred while updating the policy.", "Server error occurred while updating the policy.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "policy-modify", roles = {"emm-admin"}) @Permission(scope = "policy:modify", roles = {"admin"})
Response updatePolicy( Response updatePolicy(
@ApiParam( @ApiParam(
name = "id", name = "id",
@ -329,7 +329,7 @@ public interface PolicyManagementService {
"Server error occurred while bulk removing policies.", "Server error occurred while bulk removing policies.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "policy-modify", roles = {"emm-admin"}) @Permission(scope = "policy:modify", roles = {"admin"})
Response removePolicies( Response removePolicies(
@ApiParam( @ApiParam(
name = "policyIds", name = "policyIds",
@ -365,7 +365,7 @@ public interface PolicyManagementService {
message = "ErrorResponse in activating policies.", message = "ErrorResponse in activating policies.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "policy-modify", roles = {"emm-admin"}) @Permission(scope = "policy:add", roles = {"admin"})
Response activatePolicies( Response activatePolicies(
@ApiParam( @ApiParam(
name = "policyIds", name = "policyIds",
@ -401,7 +401,7 @@ public interface PolicyManagementService {
message = "ErrorResponse in deactivating policies.", message = "ErrorResponse in deactivating policies.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "policy-modify", roles = {"emm-admin"}) @Permission(scope = "policy:add", roles = {"admin"})
Response deactivatePolicies( Response deactivatePolicies(
@ApiParam( @ApiParam(
name = "policyIds", name = "policyIds",
@ -434,7 +434,7 @@ public interface PolicyManagementService {
message = "ErrorResponse in deactivating policies.", message = "ErrorResponse in deactivating policies.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "policy-modify", roles = {"emm-admin"}) @Permission(scope = "policy:add", roles = {"admin"})
Response applyChanges(); Response applyChanges();
@ -463,7 +463,7 @@ public interface PolicyManagementService {
message = "Exception in updating policy priorities.", message = "Exception in updating policy priorities.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "policy-modify", roles = {"emm-admin"}) @Permission(scope = "policy:add", roles = {"admin"})
Response updatePolicyPriorities( Response updatePolicyPriorities(
@ApiParam( @ApiParam(
name = "priorityUpdatedPolicies", name = "priorityUpdatedPolicies",

@ -77,7 +77,7 @@ public interface RoleManagementService {
message = "Internal Server Error. \n Server error occurred while fetching requested list of roles.", message = "Internal Server Error. \n Server error occurred while fetching requested list of roles.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "roles-view", roles = {"emm-admin"}) @Permission(scope = "roles:list", roles = {"admin"})
Response getRoles( Response getRoles(
@ApiParam( @ApiParam(
name = "filter", name = "filter",
@ -159,7 +159,7 @@ public interface RoleManagementService {
message = "Internal Server ErrorResponse. \n Server error occurred while fetching the permission list of the requested role.", message = "Internal Server ErrorResponse. \n Server error occurred while fetching the permission list of the requested role.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "roles-view", roles = {"emm-admin"}) @Permission(scope = "roles:view", roles = {"admin"})
Response getPermissionsOfRole( Response getPermissionsOfRole(
@ApiParam( @ApiParam(
name = "roleName", name = "roleName",
@ -222,7 +222,7 @@ public interface RoleManagementService {
"requested role.", "requested role.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "roles-view", roles = {"emm-admin"}) @Permission(scope = "roles:view", roles = {"admin"})
Response getRole( Response getRole(
@ApiParam( @ApiParam(
name = "roleName", name = "roleName",
@ -282,7 +282,7 @@ public interface RoleManagementService {
message = "Internal Server Error. \n Server error occurred while adding a new role.", message = "Internal Server Error. \n Server error occurred while adding a new role.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "roles-modify", roles = {"emm-admin"}) @Permission(scope = "roles:add", roles = {"admin"})
Response addRole( Response addRole(
@ApiParam( @ApiParam(
name = "role", name = "role",
@ -332,7 +332,7 @@ public interface RoleManagementService {
message = "Internal Server Error. \n Server error occurred while updating the role.", message = "Internal Server Error. \n Server error occurred while updating the role.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "roles-modify", roles = {"emm-admin"}) @Permission(scope = "roles:modify", roles = {"admin"})
Response updateRole( Response updateRole(
@ApiParam( @ApiParam(
name = "roleName", name = "roleName",
@ -369,7 +369,7 @@ public interface RoleManagementService {
message = "Internal Server Error. \n Server error occurred while removing the role.", message = "Internal Server Error. \n Server error occurred while removing the role.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "roles-modify", roles = {"emm-admin"}) @Permission(scope = "roles:modify", roles = {"admin"})
Response deleteRole( Response deleteRole(
@ApiParam( @ApiParam(
name = "roleName", name = "roleName",
@ -427,7 +427,7 @@ public interface RoleManagementService {
"Server error occurred while updating the user list of the role.", "Server error occurred while updating the user list of the role.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "roles-modify", roles = {"emm-admin"}) @Permission(scope = "roles:modify", roles = {"admin"})
Response updateUsersOfRole( Response updateUsersOfRole(
@ApiParam( @ApiParam(
name = "roleName", name = "roleName",

@ -74,7 +74,7 @@ public interface ApplicationManagementAdminService {
"a given set of devices.", "a given set of devices.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "application-modify", roles = {"emm-admin"}) @Permission(scope = "application:install", roles = {"admin"})
Response installApplication( Response installApplication(
@ApiParam( @ApiParam(
name = "applicationWrapper", name = "applicationWrapper",
@ -113,7 +113,7 @@ public interface ApplicationManagementAdminService {
"a given set of devices.", "a given set of devices.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "application-modify", roles = {"emm-admin"}) @Permission(scope = "application:uninstall", roles = {"admin"})
Response uninstallApplication( Response uninstallApplication(
@ApiParam( @ApiParam(
name = "applicationWrapper", name = "applicationWrapper",

@ -84,7 +84,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n Server error occurred while fetching the device list.", message = "Internal Server Error. \n Server error occurred while fetching the device list.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "device-view", roles = {"emm-admin"}) @Permission(scope = "device:view", roles = {"admin"})
Response getDevicesByName( Response getDevicesByName(
@ApiParam( @ApiParam(
name = "name", name = "name",

@ -67,7 +67,7 @@ public interface UserManagementAdminService {
"Server error occurred while updating credentials of the user.", "Server error occurred while updating credentials of the user.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
@Permission(scope = "user-modify", roles = {"emm-admin"}) @Permission(scope = "user:modify", roles = {"admin"})
Response resetUserPassword( Response resetUserPassword(
@ApiParam( @ApiParam(
name = "username", name = "username",

Loading…
Cancel
Save