pub struct PolicyEvaluator<'a> { /* private fields */ }Expand description
Engine-side implementation of the policy evaluator trait.
Holds references to Services (for functions/clock) and SymbolTable
(for variable resolution), and compiles+evaluates RQL expressions.
Implementations§
Source§impl<'a> PolicyEvaluator<'a>
impl<'a> PolicyEvaluator<'a>
pub fn new(services: &'a Arc<Services>, symbol_table: &'a SymbolTable) -> Self
pub fn enforce_write_policies( &self, tx: &mut Transaction<'_>, identity: IdentityId, target_namespace: &str, target_object: &str, operation: &str, row_columns: &Columns, target_type: PolicyTargetType, ) -> Result<()>
pub fn enforce_session_policy( &self, tx: &mut Transaction<'_>, identity: IdentityId, session_type: &str, default_deny: bool, ) -> Result<()>
pub fn enforce_identity_policy( &self, tx: &mut Transaction<'_>, identity: IdentityId, target_namespace: &str, target_object: &str, operation: &str, target_type: PolicyTargetType, ) -> Result<()>
Trait Implementations§
Source§impl PolicyEvaluator for PolicyEvaluator<'_>
impl PolicyEvaluator for PolicyEvaluator<'_>
Source§fn evaluate_condition(
&self,
expr: &Expression,
columns: &Columns,
row_count: usize,
identity: IdentityId,
) -> Result<bool>
fn evaluate_condition( &self, expr: &Expression, columns: &Columns, row_count: usize, identity: IdentityId, ) -> Result<bool>
Evaluate a condition expression against the given columns and identity. Read more
Auto Trait Implementations§
impl<'a> Freeze for PolicyEvaluator<'a>
impl<'a> !RefUnwindSafe for PolicyEvaluator<'a>
impl<'a> Send for PolicyEvaluator<'a>
impl<'a> Sync for PolicyEvaluator<'a>
impl<'a> Unpin for PolicyEvaluator<'a>
impl<'a> UnsafeUnpin for PolicyEvaluator<'a>
impl<'a> !UnwindSafe for PolicyEvaluator<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more