pub struct PortfolioAccessControl { /* private fields */ }Expand description
Portfolio access control
Implementations§
Source§impl PortfolioAccessControl
impl PortfolioAccessControl
Sourcepub fn add_access_policy(&mut self, policy: AccessPolicy)
pub fn add_access_policy(&mut self, policy: AccessPolicy)
Register an access policy. The policy is keyed by its policy_id and
grants user_id the listed permissions over portfolio_id.
Sourcepub fn check_permission(
&self,
user_id: &str,
portfolio_id: &str,
required_permission: Permission,
) -> bool
pub fn check_permission( &self, user_id: &str, portfolio_id: &str, required_permission: Permission, ) -> bool
Return true iff some registered policy grants user_id the
required_permission on portfolio_id. No matching policy ⇒ false
(deny by default — never a fabricated grant).
Sourcepub fn add_authentication_requirement(
&mut self,
requirement: AuthenticationRequirement,
)
pub fn add_authentication_requirement( &mut self, requirement: AuthenticationRequirement, )
Add authentication_requirement to the PortfolioAccessControl.
Sourcepub fn get_authentication_requirement(
&self,
requirement_id: &str,
) -> Option<&AuthenticationRequirement>
pub fn get_authentication_requirement( &self, requirement_id: &str, ) -> Option<&AuthenticationRequirement>
Look up authentication_requirement by id; None when absent.
Sourcepub fn list_authentication_requirements(&self) -> Vec<String>
pub fn list_authentication_requirements(&self) -> Vec<String>
Ids of every registered authentication_requirement.
Sourcepub fn is_audit_logging_enabled(&self) -> bool
pub fn is_audit_logging_enabled(&self) -> bool
true when audit logging is enabled.
Sourcepub fn set_audit_logging(&mut self, enabled: bool)
pub fn set_audit_logging(&mut self, enabled: bool)
Replace the audit_logging.
Auto Trait Implementations§
impl Freeze for PortfolioAccessControl
impl RefUnwindSafe for PortfolioAccessControl
impl Send for PortfolioAccessControl
impl Sync for PortfolioAccessControl
impl Unpin for PortfolioAccessControl
impl UnsafeUnpin for PortfolioAccessControl
impl UnwindSafe for PortfolioAccessControl
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more