pub struct DataAccessPolicy {
pub allowed_labels: Vec<String>,
pub denied_rel_types: Vec<String>,
pub visible_properties: BTreeMap<String, Vec<String>>,
pub max_results: u64,
}Expand description
Tenant-scoped data-access restrictions applied to query results.
Fields§
§allowed_labels: Vec<String>Label allow-list, compared as label names are (case-insensitive,
see crate::value::normalize_name). ["*"]
(ALL_LABELS) allows every label, including labels created later;
an empty list allows none, so an enforced policy without labels locks
the tenant’s data (reads and writes).
denied_rel_types: Vec<String>Relationship types that readers must not traverse.
visible_properties: BTreeMap<String, Vec<String>>Per label, the only properties a reader sees (an allow-list); a label without an entry shows all of its properties.
max_results: u64Maximum number of rows a query may return.
Implementations§
Source§impl DataAccessPolicy
impl DataAccessPolicy
Sourcepub fn allows_every_label(&self) -> bool
pub fn allows_every_label(&self) -> bool
Whether the allow-list holds ALL_LABELS.
Sourcepub fn allows_label(&self, label: &str) -> bool
pub fn allows_label(&self, label: &str) -> bool
Whether label is allowed: ALL_LABELS is listed, or a name equal
to label once normalized (crate::value::normalize_name). Every
read and write check of the allow-list goes through here.
Trait Implementations§
Source§impl Clone for DataAccessPolicy
impl Clone for DataAccessPolicy
Source§impl Debug for DataAccessPolicy
impl Debug for DataAccessPolicy
Source§impl Default for DataAccessPolicy
impl Default for DataAccessPolicy
Source§impl<'de> Deserialize<'de> for DataAccessPolicy
impl<'de> Deserialize<'de> for DataAccessPolicy
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>,
impl Eq for DataAccessPolicy
Source§impl PartialEq for DataAccessPolicy
impl PartialEq for DataAccessPolicy
Source§impl Serialize for DataAccessPolicy
impl Serialize for DataAccessPolicy
impl StructuralPartialEq for DataAccessPolicy
Auto Trait Implementations§
impl Freeze for DataAccessPolicy
impl RefUnwindSafe for DataAccessPolicy
impl Send for DataAccessPolicy
impl Sync for DataAccessPolicy
impl Unpin for DataAccessPolicy
impl UnsafeUnpin for DataAccessPolicy
impl UnwindSafe for DataAccessPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.