Overview

The OrganizationRoleListResponse struct represents the response returned when fetching roles within an organization.

Definition

pub struct OrganizationRoleListResponse {
    pub data: Vec<OrganizationRole>,
}

Fields

data
Vec<OrganizationRole>
required
A vector containing all roles defined for the organization. Each role includes permissions and metadata.

Usage Example

use wacht::api::organizations::*;

let organization_id = "org_123";
let response = fetch_organization_roles(organization_id).await?;

println!("Found {} roles", response.data.len());

for role in response.data {
    println!("Role: {} ({})", role.name, role.id);
    println!("  Description: {}", role.description.unwrap_or_default());
    println!("  Permissions: {:?}", role.permissions);
    println!("  Is Custom: {}", role.is_custom);
}

// Find admin role
let admin_role = response.data.iter()
    .find(|r| r.name == "admin")
    .expect("Admin role not found");

Role Types

Organizations typically have:
  • Built-in roles: admin, member, viewer
  • Custom roles: Created by organization administrators

See Also