Skip to main content

AccessState

Struct AccessState 

Source
pub struct AccessState { /* private fields */ }

Implementations§

Source§

impl AccessState

Source

pub fn new(records: Vec<StoredAccess>) -> Result<Self, String>

Source

pub fn create(&mut self, record: StoredAccess) -> Result<(), String>

Source

pub fn replace( &mut self, access_id: AccessId, revision: TxId, policy: AccessPolicy, ) -> Result<(), String>

Source

pub fn profile_id(&self, access_id: AccessId) -> Option<ProfileId>

Source

pub fn controller_profile_ids( &self, context: &AccessContext, access_ids: &[AccessId], user_groups: &[GroupId], ) -> Vec<Option<ProfileId>>

Source

pub fn check( &self, context: &AccessContext, access_id: AccessId, expected_subsystem: SubsystemId, user_groups: &[GroupId], model_groups: &[GroupId], groups_revision: Option<TxId>, ) -> AccessCheck

Source

pub fn check_many( &self, context: &AccessContext, access_ids: &[AccessId], expected_subsystem: SubsystemId, user_groups: &[GroupId], model_groups: &[GroupId], groups_revision: Option<TxId>, ) -> Vec<AccessCheck>

Source

pub fn resolve_visible_targets( &self, context: &AccessContext, targets: &[Target], expected_subsystem: SubsystemId, user_groups: &[GroupId], model_groups: &[GroupId], ) -> Vec<Option<AccessId>>

Source

pub fn accepts_edit_witness( &self, access_id: AccessId, witness: Authority, ) -> bool

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.