List roles assigned to a group
curl --request GET \
--url https://services.pref.rio/heimdall-admin/api/v1/roles/groups/{group_name}/roles \
--header 'Authorization: Bearer <token>'import requests
url = "https://services.pref.rio/heimdall-admin/api/v1/roles/groups/{group_name}/roles"
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/groups/{group_name}/roles', 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/groups/{group_name}/roles",
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/groups/{group_name}/roles"
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/groups/{group_name}/roles")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.pref.rio/heimdall-admin/api/v1/roles/groups/{group_name}/roles")
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": "data_analyst:read",
"description": "Data analysis and reporting access"
},
{
"id": 2,
"name": "team_lead:manage",
"description": "Team leadership and management permissions"
}
]{
"detail": "Could not validate credentials"
}{
"detail": "Permission denied to view roles of group 'engineering_team:backend'"
}{
"detail": "Group 'unknown-group' not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Failed to retrieve group roles: Database connection error"
}roles
List roles assigned to a group
List all roles assigned to a specific group.
Authorization: Users can view roles of groups they have permission to access. Permissions are checked via Cerbos policies.
Role Information: Returns each role’s ID, name, and description.
Use Cases:
- View group permissions and capabilities
- Audit group role assignments
- Administrative oversight of access control
- Verify role inheritance for group members
Sorting: Roles are returned sorted by name (alphabetical order).
GET
/
api
/
v1
/
roles
/
groups
/
{group_name}
/
roles
List roles assigned to a group
curl --request GET \
--url https://services.pref.rio/heimdall-admin/api/v1/roles/groups/{group_name}/roles \
--header 'Authorization: Bearer <token>'import requests
url = "https://services.pref.rio/heimdall-admin/api/v1/roles/groups/{group_name}/roles"
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/groups/{group_name}/roles', 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/groups/{group_name}/roles",
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/groups/{group_name}/roles"
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/groups/{group_name}/roles")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.pref.rio/heimdall-admin/api/v1/roles/groups/{group_name}/roles")
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": "data_analyst:read",
"description": "Data analysis and reporting access"
},
{
"id": 2,
"name": "team_lead:manage",
"description": "Team leadership and management permissions"
}
]{
"detail": "Could not validate credentials"
}{
"detail": "Permission denied to view roles of group 'engineering_team:backend'"
}{
"detail": "Group 'unknown-group' not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Failed to retrieve group roles: Database connection error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
List of group roles retrieved successfully
Unique identifier for the role
Example:
1
Role name
Example:
"data_analyst:read"
Role description
Example:
"Data analysts with read access to analytics dashboards"
CPF of the user who created this role (null for system roles)
Example:
"12345678901"
ISO timestamp when the role was created (null for system roles)
Example:
"2024-01-15T10:30:00Z"
