List actions allowed for a role
curl --request GET \
--url https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions \
--header 'Authorization: Bearer <token>'import requests
url = "https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": 1,
"name": "user:read",
"description": "Read user information"
},
{
"id": 2,
"name": "user:list",
"description": "List users in the system"
}
]{
"detail": "Could not validate credentials"
}{
"detail": "Permission denied to view actions for role 'data_analyst:read'"
}{
"detail": "Role 'unknown-role' not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Failed to retrieve role actions: Policy service error"
}roles
List actions allowed for a role
List all actions that a specific role can perform.
Authorization: Users can view actions for roles they have permission to access. Permissions are checked via Cerbos policies.
Action Information: Returns each action’s ID, name, and description.
Use Cases:
- Audit role permissions and capabilities
- Verify role-based access control configuration
- Administrative oversight of security policies
- Integration with external systems requiring permission information
Sorting: Actions are returned sorted by name (alphabetical order).
Note: This endpoint returns actions based on current Cerbos policy configuration.
GET
/
api
/
v1
/
roles
/
{role_name}
/
actions
List actions allowed for a role
curl --request GET \
--url https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions \
--header 'Authorization: Bearer <token>'import requests
url = "https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.pref.rio/heimdall-admin/api/v1/roles/{role_name}/actions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": 1,
"name": "user:read",
"description": "Read user information"
},
{
"id": 2,
"name": "user:list",
"description": "List users in the system"
}
]{
"detail": "Could not validate credentials"
}{
"detail": "Permission denied to view actions for role 'data_analyst:read'"
}{
"detail": "Role 'unknown-role' not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Failed to retrieve role actions: Policy service error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
