Skip to main content

Role

Definition

role.json
{
"id": 0,
"roleName": "",
"roleDescription": "",
"status": 0,
"createdAt": "",
"updatedAt": "",
}

Get Roles

curl -X GET "${baseUrl}/role/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Get Role

curl -X GET "${baseUrl}/role/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Apply Role.ID

curl -X POST "${baseUrl}/apply/role/id/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Create Role

curl -X POST "${baseUrl}/role/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @role.json
info
role.json
{
"roleName": "",
"roleDescription": "",
"status": 0,
}
tip

success status: 201

Update Role

#!/bin/bash
curl -X PUT "${baseUrl}/role/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @role.json
info
role.json
{
"roleName": "",
"roleDescription": "",
"status": 0,
}

Patch Role

curl -X PATCH "${baseUrl}/role/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Attrs: roleName,roleDescription,status" \
-d @role.json
info
role.json
{
"roleName": "",
"roleDescription": "",
"status": 0,
}

Update Role Status

curl -X PATCH "${baseUrl}/role/${id}/status/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @role.json
info
role.json
{
"status": 0
}

Destroy Role

curl -X DELETE "${baseUrl}/role/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Get Applications

curl -X GET "${baseUrl}/role/${id}/application/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
curl -X POST "${baseUrl}/role/${id}/application/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"
curl -X DELETE "${baseUrl}/role/${id}/application/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"

Get ApplicationRole

curl -X GET "${baseUrl}/role/${id}/application/${applicationID}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Update ApplicationRole

curl -X PUT "${baseUrl}/role/${id}/application/${applicationID}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @applicationRole.json
info
applicationRole.json
{
"right": 0,
}

Get Users

curl -X GET "${baseUrl}/role/${id}/user/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
curl -X POST "${baseUrl}/role/${id}/user/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"
curl -X DELETE "${baseUrl}/role/${id}/user/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"