#[non_exhaustive]pub struct AccessRestriction {
pub principals: Vec<Principal>,
pub idp_wide: bool,
/* private fields */
}Available on crate features
conversational-search-service or document-service or recommendation-service or search-service only.Expand description
AclRestriction to model complex inheritance restrictions.
Example: Modeling a “Both Permit” inheritance, where to access a child document, user needs to have access to parent document.
Document Hierarchy - Space_S –> Page_P.
Readers: Space_S: group_1, user_1 Page_P: group_2, group_3, user_2
Space_S ACL Restriction - { “acl_info”: { “readers”: [ { “principals”: [ { “group_id”: “group_1” }, { “user_id”: “user_1” } ] } ] } }
Page_P ACL Restriction. { “acl_info”: { “readers”: [ { “principals”: [ { “group_id”: “group_2” }, { “group_id”: “group_3” }, { “user_id”: “user_2” } ], }, { “principals”: [ { “group_id”: “group_1” }, { “user_id”: “user_1” } ], } ] } }
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.principals: Vec<Principal>List of principals.
idp_wide: boolAll users within the Identity Provider.
Implementations§
Source§impl AccessRestriction
impl AccessRestriction
pub fn new() -> Self
Sourcepub fn set_principals<T, V>(self, v: T) -> Self
pub fn set_principals<T, V>(self, v: T) -> Self
Sets the value of principals.
§Example
ⓘ
use google_cloud_discoveryengine_v1::model::Principal;
let x = AccessRestriction::new()
.set_principals([
Principal::default()/* use setters */,
Principal::default()/* use (different) setters */,
]);Trait Implementations§
Source§impl Clone for AccessRestriction
impl Clone for AccessRestriction
Source§fn clone(&self) -> AccessRestriction
fn clone(&self) -> AccessRestriction
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 AccessRestriction
impl Debug for AccessRestriction
Source§impl Default for AccessRestriction
impl Default for AccessRestriction
Source§fn default() -> AccessRestriction
fn default() -> AccessRestriction
Returns the “default value” for a type. Read more
Source§impl Message for AccessRestriction
impl Message for AccessRestriction
Source§impl PartialEq for AccessRestriction
impl PartialEq for AccessRestriction
impl StructuralPartialEq for AccessRestriction
Auto Trait Implementations§
impl Freeze for AccessRestriction
impl RefUnwindSafe for AccessRestriction
impl Send for AccessRestriction
impl Sync for AccessRestriction
impl Unpin for AccessRestriction
impl UnwindSafe for AccessRestriction
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