pub enum SystemActor {
Beginner,
SubscriptionsManager,
UsersManager,
AccountManager,
GuestsManager,
GatewayManager,
SystemManager,
TenantOwner,
TenantManager,
Service,
CustomRole(String),
}Expand description
This is a re-exportation from the myc core to allow users to import both from myc-http-tools instead of the myc-core. The System Actors
Standard actors used to validate operations during the authorization process in system use-cases.
Variants§
Beginner
Beginner
This actor is used when no role is assigned to the user.
SubscriptionsManager
Subscriptions manager
This actor is responsible for managing subscriptions accounts.
UsersManager
Users account manager
This actor is responsible for managing users accounts.
AccountManager
Account manager
This actor is responsible for managing a single subscription account.
GuestsManager
Guest manager
This actor is responsible for managing roles, guest-roles, and guest-users.
GatewayManager
Gateway manager
This actor is responsible for managing gateway endpoints and related configurations.
SystemManager
System manager
This actor is responsible for managing system, including error messages, webhooks, and others.
TenantOwner
Tenant owner
This actor is responsible for managing tenant metadata, tags, and owner.
WARNING: This is not a role in the system. Don’t use to filter licensed resource scopes during the profile checking.
❌ Wrong example:
use myc_core::domain::dtos::profile::Profile;
use myc_core::domain::actors::SystemActor;
use uuid::Uuid;
let profile = Profile::default();
let tenant_id = Uuid::new_v4();
let related_accounts = profile
.on_tenant(tenant_id)
.with_system_accounts_access()
.with_write_access()
.with_roles(vec![
SystemActor::TenantOwner,
SystemActor::TenantManager,
SystemActor::SubscriptionsManager,
])
.get_related_account_or_error();This way should check if the profile has access to the tenant as a guest role. However, tenant owner should be guest as a ownership not as a licensed resource.
✅ Right example:
use myc_core::domain::dtos::profile::Profile;
use myc_core::domain::actors::SystemActor;
use myc_core::domain::dtos::guest_role::Permission;
use uuid::Uuid;
let profile = Profile::default();
let tenant_id = Uuid::new_v4();
let related_accounts = profile
.on_tenant(tenant_id)
.with_system_accounts_access()
.with_write_access()
.with_roles(vec![
SystemActor::TenantManager,
SystemActor::SubscriptionsManager,
])
.get_related_accounts_or_tenant_wide_permission_or_error(tenant_id, Permission::Write);This way should check if the profile has ownership over the tenant.
TenantManager
Tenant manager
This actor is responsible for managing tenants.
Service
Service
This is a service entity.
CustomRole(String)
Custom role
Implementations§
Trait Implementations§
Source§impl Clone for SystemActor
impl Clone for SystemActor
Source§fn clone(&self) -> SystemActor
fn clone(&self) -> SystemActor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SystemActor
impl Debug for SystemActor
Source§impl<'de> Deserialize<'de> for SystemActor
impl<'de> Deserialize<'de> for SystemActor
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SystemActor, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SystemActor, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for SystemActor
impl Display for SystemActor
Source§impl FromStr for SystemActor
impl FromStr for SystemActor
Source§impl PartialEq for SystemActor
impl PartialEq for SystemActor
Source§impl Serialize for SystemActor
impl Serialize for SystemActor
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl ToSchema for SystemActor
impl ToSchema for SystemActor
impl Eq for SystemActor
impl StructuralPartialEq for SystemActor
Auto Trait Implementations§
impl Freeze for SystemActor
impl RefUnwindSafe for SystemActor
impl Send for SystemActor
impl Sync for SystemActor
impl Unpin for SystemActor
impl UnwindSafe for SystemActor
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,
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.