#[non_exhaustive]pub enum UserRole {
Owner,
Admin,
Scientist,
BusinessDev,
Viewer,
External,
}Expand description
Role within a tenant organization. Determines permissions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Owner
Full access + billing + team management
Admin
Full access except billing
Scientist
Programs, compounds, assays (read/write)
BusinessDev
Deals, asset packages (read/write); science (read)
Viewer
Read-only access to specified programs
External
Scoped access (SAB members, consultants)
Implementations§
Source§impl UserRole
impl UserRole
Sourcepub fn has_at_least(&self, required: &UserRole) -> bool
pub fn has_at_least(&self, required: &UserRole) -> bool
Whether this role has at least the privileges of required.
Sourcepub fn can_manage_team(&self) -> bool
pub fn can_manage_team(&self) -> bool
Whether this role can manage team members.
Sourcepub fn can_access_billing(&self) -> bool
pub fn can_access_billing(&self) -> bool
Whether this role can access billing.
Sourcepub fn can_write_programs(&self) -> bool
pub fn can_write_programs(&self) -> bool
Whether this role can write to programs.
Sourcepub fn can_manage_deals(&self) -> bool
pub fn can_manage_deals(&self) -> bool
Whether this role can manage deals.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UserRole
impl<'de> Deserialize<'de> for UserRole
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for UserRole
impl Eq for UserRole
impl StructuralPartialEq for UserRole
Auto Trait Implementations§
impl Freeze for UserRole
impl RefUnwindSafe for UserRole
impl Send for UserRole
impl Sync for UserRole
impl Unpin for UserRole
impl UnsafeUnpin for UserRole
impl UnwindSafe for UserRole
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