@ -241,17 +250,17 @@ public interface RoleManagementService {
consumes=MediaType.APPLICATION_JSON,
produces=MediaType.APPLICATION_JSON,
httpMethod="POST",
value="Add a role.",
notes="You are able to add a new role to EMM using the REST API.",
value="Adding a Role",
notes="WSO2 EMM supports role-based access control (RBAC) and role management. Add a new role to WSO2 EMM using this REST API.",
tags="Role Management")
@ApiResponses(value={
@ApiResponse(
code=201,
message="Created. \n Role has successfully been created",
message="Created. \n Successfully created the role.",
responseHeaders={
@ResponseHeader(
name="Content-Location",
description="The URL of the role added."),
description="The URL to the newly added role."),
@ResponseHeader(
name="Content-Type",
description="The content type of the body"),
@ -265,7 +274,7 @@ public interface RoleManagementService {
"Used by caches, or in conditional requests.")}),
@ApiResponse(
code=303,
message="See Other. \n Source can be retrieved from the URL specified at the Location header.",
message="See Other. \n The source can be retrieved from the URL specified in the location header.",
responseHeaders={
@ResponseHeader(
name="Content-Location",
@ -276,7 +285,7 @@ public interface RoleManagementService {
response=ErrorResponse.class),
@ApiResponse(
code=415,
message="Unsupported media type. \n The entity of the request was in a not supported format.",
message="Unsupported media type. \n The format of the requested entity was not supported.",
response=ErrorResponse.class),
@ApiResponse(
code=500,
@ -287,7 +296,7 @@ public interface RoleManagementService {
ResponseaddRole(
@ApiParam(
name="role",
value="Details about the role to be added.",
value="The properties required to add a new role.",
required=true)RoleInforole);
@PUT
@ -296,14 +305,14 @@ public interface RoleManagementService {
consumes=MediaType.APPLICATION_JSON,
produces=MediaType.APPLICATION_JSON,
httpMethod="PUT",
value="Update a role.",
notes="There will be situations where you will need to update the role details, such as the permissions" +
" or the role name. In such situation you can update the role details.",
value="Updating Role Details",
notes="There will be situations where you need to update the role details, such as the permissions" +
" or the role name. Update the role details using this REST API.",
tags="Role Management")
@ApiResponses(value={
@ApiResponse(
code=200,
message="OK. \n Role has been updated successfully",
message="OK. \n Successfully updated the specified role.",
responseHeaders={
@ResponseHeader(
name="Content-Type",
@ -314,7 +323,7 @@ public interface RoleManagementService {
"Used by caches, or in conditional requests."),
@ResponseHeader(
name="Last-Modified",
description="Date and time the resource has been modified the last time.\n" +
description="Date and time the resource was last modified.\n" +
"Used by caches, or in conditional requests.")}),
@ApiResponse(
code=400,
@ -322,11 +331,11 @@ public interface RoleManagementService {
response=ErrorResponse.class),
@ApiResponse(
code=404,
message="Not Found. \n Role to be deleted does not exist.",
message="Not Found. \n The specified role does not exist.",
response=ErrorResponse.class),
@ApiResponse(
code=415,
message="Unsupported media type. \n The entity of the request was in a not supported format.",
message="Unsupported media type. \n The format of the requested entity was not supported.\n",
response=ErrorResponse.class),
@ApiResponse(
code=500,
@ -337,33 +346,34 @@ public interface RoleManagementService {
ResponseupdateRole(
@ApiParam(
name="roleName",
value="Name of the role.",
required=true)
value="The name of the role.",
required=true,
defaultValue="engineer")
@PathParam("roleName")StringroleName,
@ApiParam(
name="role",
value="Details about the role to be added.",
value="The properties required to update a role.",
required=true)RoleInforole);
@DELETE
@Path("/{roleName}")
@ApiOperation(
httpMethod="DELETE",
value="Delete a role.",
notes="In a situation when your Organization identifies that a specific role is no longer required you " +
"will need to remove the role details from EMM.",
value="Deleting a Role",
notes="Roles become obsolete over time due to various reasons. In a situation where your Organization identifies that a specific role is no longer required, you " +
"can delete a role using this REST API.",
tags="Role Management")
@ApiResponses(value={
@ApiResponse(
code=200,
message="OK. \n Role has successfully been removed"),
message="OK. \n Successfully removed the specified role."),
@ApiResponse(
code=400,
message="Bad Request. \n Invalid request or validation error.",
response=ErrorResponse.class),
@ApiResponse(
code=404,
message="Not Found. \n Role to be deleted does not exist.",
message="Not Found. \n The specified role does not exist.",
response=ErrorResponse.class),
@ApiResponse(
code=500,
@ -374,8 +384,9 @@ public interface RoleManagementService {
ResponsedeleteRole(
@ApiParam(
name="roleName",
value="Name of the role to de deleted.",
required=true)
value="The name of the role that needs to de deleted.",
required=true,
defaultValue="engineer")
@PathParam("roleName")StringroleName);
@PUT
@ -384,19 +395,19 @@ public interface RoleManagementService {
consumes=MediaType.APPLICATION_JSON,
produces=MediaType.APPLICATION_JSON,
httpMethod="PUT",
value="Add users to a role.",
notes="Defining the users to a role at the point of creating a new role is optional, " +
"therefore you are able to update the users that belong to a given role after you have created " +
"a role using this REST API." +
value="Adding Users to a Role",
notes="Defining users to a role at the point of creating a new role is optional. " +
"You can update the users that belong to a given role after you have created " +
"a role using this REST API.\n" +
"Example: Your Organization hires 30 new engineers. Updating the role details for each user can "+
"be cumbersome, therefore you can define all the new employees that belong to the engineering " +
"be cumbersome. Therefore, you can define all the new employees that belong to the engineering " +
"role using this API.",
tags="Role Management")
@ApiResponses(
value={
@ApiResponse(
code=200,
message="OK. \n User list of the role has been updated successfully",
message="OK. \n Successfully added the users to the specified role.",
responseHeaders={
@ResponseHeader(
name="Content-Type",
@ -415,17 +426,17 @@ public interface RoleManagementService {
response=ErrorResponse.class),
@ApiResponse(
code=404,
message="Not Found. \n Resource to be deleted does not exist.",
message="Not Found. \n The specified role does not exist.",
response=ErrorResponse.class),
@ApiResponse(
code=415,
message="Unsupported media type. \n The entity of the request was in a not " +
message="Unsupported media type. \n The format of the requested entity was not supported.\n" +
"supported format.",
response=ErrorResponse.class),
@ApiResponse(
code=500,
message="Internal Server Error. \n "+
"Server error occurred while updating the user list of the role.",
"Server error occurred while adding the user to the specified role.",