Skip to content

RolesApi

Víctor Cañizares edited this page Dec 14, 2020 · 1 revision

RolesApi

All URIs are relative to https://demo.iriusrisk.com/api/v1

Method HTTP request Description
rolesPost POST /roles Creates a new Role
rolesRoleNameDelete DELETE /roles/{role_name} Deletes an existing role

rolesPost

rolesPost(apiToken, createRoleRequestBody)

Creates a new Role

Creates a new role. Conditions to be able to perform the action: - To have the permission ROLES_UPDATE granted.

Example

// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.RolesApi;


RolesApi apiInstance = new RolesApi();
String apiToken = "apiToken_example"; // String | Authentication token
CreateRoleRequestBody createRoleRequestBody = new CreateRoleRequestBody(); // CreateRoleRequestBody | JSON data that contains information of the fields
try {
    apiInstance.rolesPost(apiToken, createRoleRequestBody);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesApi#rolesPost");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
apiToken String Authentication token
createRoleRequestBody CreateRoleRequestBody JSON data that contains information of the fields

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

rolesRoleNameDelete

rolesRoleNameDelete(apiToken, roleName)

Deletes an existing role

Deletes an existing role. Conditions to be able to perform the action: - To have the permission ROLES_UPDATE granted.

Example

// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.RolesApi;


RolesApi apiInstance = new RolesApi();
String apiToken = "apiToken_example"; // String | Authentication token
String roleName = "roleName_example"; // String | Role name to delete
try {
    apiInstance.rolesRoleNameDelete(apiToken, roleName);
} catch (ApiException e) {
    System.err.println("Exception when calling RolesApi#rolesRoleNameDelete");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
apiToken String Authentication token
roleName String Role name to delete

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json
Clone this wiki locally