//! Flattening role inheritance into concrete grants.
use crate;
/// A single `(permission, resource_patterns)` grant, with patterns still in
/// their raw string form (compiled later by the engine).
pub
/// Flatten a role's permissions by resolving inheritance.
///
/// Walks the role's inheritance closure (own role first, then inherited roles
/// in declaration order) and emits one [`Grant`] per `(permission, resources)`
/// pair. The cycle guard inside [`walk_inheritance`] makes this safe even though
/// cycles are already rejected by [`RbacPolicy::validate`].
pub