pub struct RoleGraph {
pub roles: BTreeMap<String, RoleState>,
pub schemas: BTreeMap<String, SchemaState>,
pub grants: BTreeMap<GrantKey, GrantState>,
pub default_privileges: BTreeMap<DefaultPrivKey, DefaultPrivState>,
pub memberships: BTreeSet<MembershipEdge>,
pub grant_absences: BTreeMap<GrantKey, BTreeSet<Privilege>>,
pub default_privilege_absences: BTreeMap<DefaultPrivKey, BTreeSet<Privilege>>,
}Expand description
Complete state of managed roles, grants, default privileges, and memberships.
Both the manifest expander and the database inspector produce this type.
The diff engine compares two RoleGraph instances to compute changes.
Fields§
§roles: BTreeMap<String, RoleState>Managed roles, keyed by role name.
schemas: BTreeMap<String, SchemaState>Managed schemas, keyed by schema name.
grants: BTreeMap<GrantKey, GrantState>Object privilege grants, keyed by grant target.
default_privileges: BTreeMap<DefaultPrivKey, DefaultPrivState>Default privilege rules, keyed by (owner, scope, type, grantee).
memberships: BTreeSet<MembershipEdge>Membership edges.
grant_absences: BTreeMap<GrantKey, BTreeSet<Privilege>>Privileges asserted absent per grant target (ensure: absent).
Only the desired graph populates this; inspection leaves it empty.
default_privilege_absences: BTreeMap<DefaultPrivKey, BTreeSet<Privilege>>Privileges asserted absent per default-privilege rule. Only the desired graph populates this; inspection leaves it empty.
Implementations§
Source§impl RoleGraph
impl RoleGraph
Sourcepub fn from_expanded(
expanded: &ExpandedManifest,
default_owner: Option<&str>,
) -> Result<Self, ManifestError>
pub fn from_expanded( expanded: &ExpandedManifest, default_owner: Option<&str>, ) -> Result<Self, ManifestError>
Build a RoleGraph from an ExpandedManifest.
This converts the manifest’s user-facing types into the normalized model that the diff engine operates on.