pub struct GraphRule {
pub effect: RuleEffect,
pub subject: Option<String>,
pub subject_has_role: Option<String>,
pub action: String,
pub resource: String,
pub conditions: GraphConditions,
}Expand description
One authored graph-policy rule: a subject/action/resource match plus optional graph-shaped conditions, yielding an allow or deny effect.
Fields§
§effect: RuleEffectWhether a match grants (allow, the default) or forbids (deny).
subject: Option<String>Match a literal subject id. Mutually informative with subject_has_role.
subject_has_role: Option<String>Match any subject holding this role (via a HAS_ROLE edge in the graph).
action: StringAction this rule governs (e.g. write).
resource: StringResource glob this rule governs (e.g. employee/private/*).
conditions: GraphConditionsOptional graph-shaped conditions (the where block) that must also hold.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GraphRule
impl<'de> Deserialize<'de> for GraphRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GraphRule
impl RefUnwindSafe for GraphRule
impl Send for GraphRule
impl Sync for GraphRule
impl Unpin for GraphRule
impl UnsafeUnpin for GraphRule
impl UnwindSafe for GraphRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more