pub enum ScopeFilter {
Eq(EqScopeFilter),
In(InScopeFilter),
}Expand description
A single scope filter — a typed predicate on a named resource property.
The property name (e.g., "owner_tenant_id", "id") is an authorization
concept. Mapping to DB columns is done by ScopableEntity::resolve_property().
Variants mirror the predicate types from the PDP response:
ScopeFilter::Eq— equality (property = value)ScopeFilter::In— set membership (property IN (values))
§Future extensions
Additional filter types (in_tenant_subtree, in_group,
in_group_subtree) are planned. See the authorization design document
(docs/arch/authorization/DESIGN.md) for the full predicate taxonomy.
Variants§
Eq(EqScopeFilter)
Equality: property = value.
In(InScopeFilter)
Set membership: property IN (values).
Implementations§
Source§impl ScopeFilter
impl ScopeFilter
Sourcepub fn eq(property: impl Into<String>, value: impl Into<ScopeValue>) -> Self
pub fn eq(property: impl Into<String>, value: impl Into<ScopeValue>) -> Self
Create an equality filter (property = value).
Sourcepub fn in(property: impl Into<String>, values: Vec<ScopeValue>) -> Self
pub fn in(property: impl Into<String>, values: Vec<ScopeValue>) -> Self
Create a set membership filter (property IN (values)).
Sourcepub fn in_uuids(property: impl Into<String>, uuids: Vec<Uuid>) -> Self
pub fn in_uuids(property: impl Into<String>, uuids: Vec<Uuid>) -> Self
Create a set membership filter from UUID values (convenience).
Sourcepub fn values(&self) -> ScopeFilterValues<'_>
pub fn values(&self) -> ScopeFilterValues<'_>
Collect all values as a slice-like view for iteration.
For Eq, returns a single-element slice; for In, returns the values slice.
Sourcepub fn uuid_values(&self) -> Vec<Uuid>
pub fn uuid_values(&self) -> Vec<Uuid>
Extract filter values as UUIDs, skipping non-UUID entries.
Useful when the caller knows the property holds UUID values
(e.g., owner_tenant_id, id).
Trait Implementations§
Source§impl Clone for ScopeFilter
impl Clone for ScopeFilter
Source§fn clone(&self) -> ScopeFilter
fn clone(&self) -> ScopeFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more