pub struct UserPermissions {Show 16 fields
pub level: u8,
pub max_tier: String,
pub model_access: Vec<String>,
pub model_denylist: Vec<String>,
pub tool_access: Vec<String>,
pub tool_denylist: Vec<String>,
pub max_context_tokens: usize,
pub max_output_tokens: usize,
pub rate_limit: u32,
pub streaming_allowed: bool,
pub escalation_allowed: bool,
pub escalation_threshold: f32,
pub model_override: bool,
pub cost_budget_daily_usd: f64,
pub cost_budget_monthly_usd: f64,
pub custom_permissions: HashMap<String, Value>,
}Expand description
Resolved user permission capabilities.
This is the runtime permission object produced by layering:
built-in defaults + level config + workspace config + user override +
channel override. Unlike PermissionLevelConfig (which uses Option
for partial overrides), all fields here are concrete values.
Fields§
§level: u8Permission level (0 = zero_trust, 1 = user, 2 = admin).
max_tier: StringMaximum model tier this user can access.
model_access: Vec<String>Explicit model allowlist. Empty = all models in allowed tiers.
model_denylist: Vec<String>Explicit model denylist.
tool_access: Vec<String>Tool names this user can invoke. ["*"] = all tools.
tool_denylist: Vec<String>Tool names explicitly denied.
max_context_tokens: usizeMaximum input context tokens.
max_output_tokens: usizeMaximum output tokens per response.
rate_limit: u32Rate limit in requests per minute. 0 = unlimited.
streaming_allowed: boolWhether SSE streaming responses are allowed.
escalation_allowed: boolWhether complexity-based escalation is allowed.
escalation_threshold: f32Complexity threshold (0.0-1.0) above which escalation triggers.
model_override: boolWhether the user can manually override model selection.
cost_budget_daily_usd: f64Daily cost budget in USD. 0.0 = unlimited. Zero-trust default: $0.10/day (see design doc Section 2.2).
cost_budget_monthly_usd: f64Monthly cost budget in USD. 0.0 = unlimited. Zero-trust default: $2.00/month (see design doc Section 2.2).
custom_permissions: HashMap<String, Value>Extensible custom permission dimensions.
Trait Implementations§
Source§impl Clone for UserPermissions
impl Clone for UserPermissions
Source§fn clone(&self) -> UserPermissions
fn clone(&self) -> UserPermissions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more