@ -241,17 +250,17 @@ public interface RoleManagementService {
consumes=MediaType.APPLICATION_JSON,
consumes=MediaType.APPLICATION_JSON,
produces=MediaType.APPLICATION_JSON,
produces=MediaType.APPLICATION_JSON,
httpMethod="POST",
httpMethod="POST",
value="Add a role.",
value="Adding a Role",
notes="You are able to add a new role to EMM using the REST API.",
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")
tags="Role Management")
@ApiResponses(value={
@ApiResponses(value={
@ApiResponse(
@ApiResponse(
code=201,
code=201,
message="Created. \n Role has successfully been created",
message="Created. \n Successfully created the role.",
responseHeaders={
responseHeaders={
@ResponseHeader(
@ResponseHeader(
name="Content-Location",
name="Content-Location",
description="The URL of the role added."),
description="The URL to the newly added role."),
@ResponseHeader(
@ResponseHeader(
name="Content-Type",
name="Content-Type",
description="The content type of the body"),
description="The content type of the body"),
@ -265,7 +274,7 @@ public interface RoleManagementService {
"Used by caches, or in conditional requests.")}),
"Used by caches, or in conditional requests.")}),
@ApiResponse(
@ApiResponse(
code=303,
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={
responseHeaders={
@ResponseHeader(
@ResponseHeader(
name="Content-Location",
name="Content-Location",
@ -276,7 +285,7 @@ public interface RoleManagementService {
response=ErrorResponse.class),
response=ErrorResponse.class),
@ApiResponse(
@ApiResponse(
code=415,
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),
response=ErrorResponse.class),
@ApiResponse(
@ApiResponse(
code=500,
code=500,
@ -287,7 +296,7 @@ public interface RoleManagementService {
ResponseaddRole(
ResponseaddRole(
@ApiParam(
@ApiParam(
name="role",
name="role",
value="Details about the role to be added.",
value="The properties required to add a new role.",
required=true)RoleInforole);
required=true)RoleInforole);
@PUT
@PUT
@ -296,14 +305,14 @@ public interface RoleManagementService {
consumes=MediaType.APPLICATION_JSON,
consumes=MediaType.APPLICATION_JSON,
produces=MediaType.APPLICATION_JSON,
produces=MediaType.APPLICATION_JSON,
httpMethod="PUT",
httpMethod="PUT",
value="Update a role.",
value="Updating Role Details",
notes="There will be situations where you will need to update the role details, such as the permissions" +
notes="There will be situations where you need to update the role details, such as the permissions" +
" or the role name. In such situation you can update the role details.",
" or the role name. Update the role details using this REST API.",
tags="Role Management")
tags="Role Management")
@ApiResponses(value={
@ApiResponses(value={
@ApiResponse(
@ApiResponse(
code=200,
code=200,
message="OK. \n Role has been updated successfully",
message="OK. \n Successfully updated the specified role.",
responseHeaders={
responseHeaders={
@ResponseHeader(
@ResponseHeader(
name="Content-Type",
name="Content-Type",
@ -314,7 +323,7 @@ public interface RoleManagementService {
"Used by caches, or in conditional requests."),
"Used by caches, or in conditional requests."),
@ResponseHeader(
@ResponseHeader(
name="Last-Modified",
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.")}),
"Used by caches, or in conditional requests.")}),
@ApiResponse(
@ApiResponse(
code=400,
code=400,
@ -322,11 +331,11 @@ public interface RoleManagementService {
response=ErrorResponse.class),
response=ErrorResponse.class),
@ApiResponse(
@ApiResponse(
code=404,
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),
response=ErrorResponse.class),
@ApiResponse(
@ApiResponse(
code=415,
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),
response=ErrorResponse.class),
@ApiResponse(
@ApiResponse(
code=500,
code=500,
@ -337,33 +346,34 @@ public interface RoleManagementService {
ResponseupdateRole(
ResponseupdateRole(
@ApiParam(
@ApiParam(
name="roleName",
name="roleName",
value="Name of the role.",
value="The name of the role.",
required=true)
required=true,
defaultValue="engineer")
@PathParam("roleName")StringroleName,
@PathParam("roleName")StringroleName,
@ApiParam(
@ApiParam(
name="role",
name="role",
value="Details about the role to be added.",
value="The properties required to update a role.",
required=true)RoleInforole);
required=true)RoleInforole);
@DELETE
@DELETE
@Path("/{roleName}")
@Path("/{roleName}")
@ApiOperation(
@ApiOperation(
httpMethod="DELETE",
httpMethod="DELETE",
value="Delete a role.",
value="Deleting a Role",
notes="In a situation when your Organization identifies that a specific role is no longer required you " +
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 " +
"will need to remove the role details from EMM.",
"can delete a role using this REST API.",
tags="Role Management")
tags="Role Management")
@ApiResponses(value={
@ApiResponses(value={
@ApiResponse(
@ApiResponse(
code=200,
code=200,
message="OK. \n Role has successfully been removed"),
message="OK. \n Successfully removed the specified role."),
@ApiResponse(
@ApiResponse(
code=400,
code=400,
message="Bad Request. \n Invalid request or validation error.",
message="Bad Request. \n Invalid request or validation error.",
response=ErrorResponse.class),
response=ErrorResponse.class),
@ApiResponse(
@ApiResponse(
code=404,
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),
response=ErrorResponse.class),
@ApiResponse(
@ApiResponse(
code=500,
code=500,
@ -374,8 +384,9 @@ public interface RoleManagementService {
ResponsedeleteRole(
ResponsedeleteRole(
@ApiParam(
@ApiParam(
name="roleName",
name="roleName",
value="Name of the role to de deleted.",
value="The name of the role that needs to de deleted.",
required=true)
required=true,
defaultValue="engineer")
@PathParam("roleName")StringroleName);
@PathParam("roleName")StringroleName);
@PUT
@PUT
@ -384,19 +395,19 @@ public interface RoleManagementService {
consumes=MediaType.APPLICATION_JSON,
consumes=MediaType.APPLICATION_JSON,
produces=MediaType.APPLICATION_JSON,
produces=MediaType.APPLICATION_JSON,
httpMethod="PUT",
httpMethod="PUT",
value="Add users to a role.",
value="Adding Users to a Role",
notes="Defining the users to a role at the point of creating a new role is optional, " +
notes="Defining 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 " +
"You can update the users that belong to a given role after you have created " +
"a role using this REST API." +
"a role using this REST API.\n" +
"Example: Your Organization hires 30 new engineers. Updating the role details for each user can "+
"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.",
"role using this API.",
tags="Role Management")
tags="Role Management")
@ApiResponses(
@ApiResponses(
value={
value={
@ApiResponse(
@ApiResponse(
code=200,
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={
responseHeaders={
@ResponseHeader(
@ResponseHeader(
name="Content-Type",
name="Content-Type",
@ -415,17 +426,17 @@ public interface RoleManagementService {
response=ErrorResponse.class),
response=ErrorResponse.class),
@ApiResponse(
@ApiResponse(
code=404,
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),
response=ErrorResponse.class),
@ApiResponse(
@ApiResponse(
code=415,
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.",
"supported format.",
response=ErrorResponse.class),
response=ErrorResponse.class),
@ApiResponse(
@ApiResponse(
code=500,
code=500,
message="Internal Server Error. \n "+
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.",