Skip to content

Role Admin Services

Ken Williamson edited this page Jan 19, 2020 · 4 revisions

Used to Add Roles for all Clients and Users

Add Role

Method: POST

URL: http://localhost:3001/rs/role/add

Request headers Example:

Content-Type = application/json
Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Request Body Example:

{
   "role":"testerrole1"
}

Response:

{
   "success": true,
   "id": 34
}

Get Role

Method: GET

URL: http://localhost:3001/rs/role/get/2


2 = role

Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Response:

{
    "id": 2,
    "role": "user"
}

Get All Roles

Method: GET

URL: http://localhost:3001/rs/role/list

Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Response:

[
    {
        "id": 1,
        "role": "admin"
    },
    {
        "id": 2,
        "role": "user"
    }
]

Delete Role

Method: DELETE

URL: http://localhost:3001/rs/role/delete/5

5 = role

Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Response:

{
    "success": true
}