pub struct CompiledRLSPolicy {
pub rules_by_type: HashMap<String, Vec<RLSRule>>,
pub default_rule: Option<RLSRule>,
/* private fields */
}Expand description
Custom RLS policy that can be configured from schema.compiled.json
This allows schema authors to define RLS rules without writing Rust code. Supports caching of policy evaluation results for performance optimization.
Fields§
§rules_by_type: HashMap<String, Vec<RLSRule>>RLS rules indexed by type name
default_rule: Option<RLSRule>Default RLS rule if no type-specific rule exists
Implementations§
Trait Implementations§
Source§impl Clone for CompiledRLSPolicy
impl Clone for CompiledRLSPolicy
Source§fn clone(&self) -> CompiledRLSPolicy
fn clone(&self) -> CompiledRLSPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompiledRLSPolicy
impl Debug for CompiledRLSPolicy
Source§impl<'de> Deserialize<'de> for CompiledRLSPolicy
impl<'de> Deserialize<'de> for CompiledRLSPolicy
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
Source§impl RLSPolicy for CompiledRLSPolicy
impl RLSPolicy for CompiledRLSPolicy
Source§fn evaluate(
&self,
context: &SecurityContext,
type_name: &str,
) -> Result<Option<WhereClause>>
fn evaluate( &self, context: &SecurityContext, type_name: &str, ) -> Result<Option<WhereClause>>
Evaluate RLS rules for the given type and security context. Read more
Source§fn cache_result(&self, cache_key: &str, result: &Option<WhereClause>)
fn cache_result(&self, cache_key: &str, result: &Option<WhereClause>)
Optional: Cache RLS decisions for performance. Read more
Auto Trait Implementations§
impl Freeze for CompiledRLSPolicy
impl !RefUnwindSafe for CompiledRLSPolicy
impl Send for CompiledRLSPolicy
impl Sync for CompiledRLSPolicy
impl Unpin for CompiledRLSPolicy
impl UnsafeUnpin for CompiledRLSPolicy
impl !UnwindSafe for CompiledRLSPolicy
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