Skip to main content

Module policy_templates

Module policy_templates 

Source
Expand description

Built-in policy templates for bootstrapping access control

Templates provide pre-configured policy rules that can be applied via CLI or PolicyService RPC.

Also defines SERVICE_BASE_POLICIES — mandatory service-to-service authorization rules that are always injected into the Casbin enforcer.

Structs§

PolicyTemplate
Built-in policy template
ServiceGrouping
A role grouping rule.
ServicePolicyRule
A single Casbin policy rule with named fields.

Constants§

SERVICE_BASE_POLICIES
Base service-to-service authorization rules.

Functions§

base_policies_to_csv
Convert structured base policies to a CSV string (for default_policy_csv only).
base_policies_to_vec
Convert structured base policies to the Vec<Vec> Casbin expects.
get_template
Get a template by name
get_templates
Get all available policy templates.