pub struct QueryCapability {
pub resource: String,
pub action: String,
pub constraints: Vec<(String, String)>,
}Expand description
A capability required to execute a query.
This integrates with Biscuit authorization - queries declare what capabilities they need, and the QueryHandler checks them before execution.
Fields§
§resource: StringResource being accessed
action: StringAction being performed (e.g., “read”, “list”)
constraints: Vec<(String, String)>Optional constraints
Implementations§
Source§impl QueryCapability
impl QueryCapability
Sourcepub fn with_constraint(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_constraint( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a constraint
Sourcepub fn to_biscuit_check(&self) -> String
pub fn to_biscuit_check(&self) -> String
Convert to Biscuit Datalog check
Trait Implementations§
Source§impl Clone for QueryCapability
impl Clone for QueryCapability
Source§fn clone(&self) -> QueryCapability
fn clone(&self) -> QueryCapability
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 QueryCapability
impl Debug for QueryCapability
Source§impl<'de> Deserialize<'de> for QueryCapability
impl<'de> Deserialize<'de> for QueryCapability
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 Hash for QueryCapability
impl Hash for QueryCapability
Source§impl PartialEq for QueryCapability
impl PartialEq for QueryCapability
Source§impl Serialize for QueryCapability
impl Serialize for QueryCapability
impl Eq for QueryCapability
impl StructuralPartialEq for QueryCapability
Auto Trait Implementations§
impl Freeze for QueryCapability
impl RefUnwindSafe for QueryCapability
impl Send for QueryCapability
impl Sync for QueryCapability
impl Unpin for QueryCapability
impl UnsafeUnpin for QueryCapability
impl UnwindSafe for QueryCapability
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.