pub struct EnvironmentPermissionChecker { /* private fields */ }๐Deprecated:
Will be extracted to mockforge-workspace crate
Expand description
Environment permission checker
Checks if a user has permission to perform an action in a specific environment, considering both base permissions and environment-specific policies.
Implementationsยง
Sourceยงimpl EnvironmentPermissionChecker
impl EnvironmentPermissionChecker
Sourcepub fn new() -> Self
๐Deprecated: Will be extracted to mockforge-workspace crate
pub fn new() -> Self
Will be extracted to mockforge-workspace crate
Create a new environment permission checker
Sourcepub fn add_policy(&mut self, policy: EnvironmentPermissionPolicy)
๐Deprecated: Will be extracted to mockforge-workspace crate
pub fn add_policy(&mut self, policy: EnvironmentPermissionPolicy)
Will be extracted to mockforge-workspace crate
Add a policy
Sourcepub fn has_permission(
&self,
role: &str,
permission: Permission,
environment: MockEnvironmentName,
) -> bool
๐Deprecated: Will be extracted to mockforge-workspace crate
pub fn has_permission( &self, role: &str, permission: Permission, environment: MockEnvironmentName, ) -> bool
Will be extracted to mockforge-workspace crate
Check if a role has permission in an environment
Returns true if:
- Thereโs no environment-specific policy (fallback to base permission check)
- Thereโs a policy and the role is allowed
Sourcepub fn get_policies_for_environment(
&self,
environment: MockEnvironmentName,
) -> Vec<&EnvironmentPermissionPolicy>
๐Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_policies_for_environment( &self, environment: MockEnvironmentName, ) -> Vec<&EnvironmentPermissionPolicy>
Will be extracted to mockforge-workspace crate
Get policies for an environment
Sourcepub fn get_policies_for_permission(
&self,
permission: Permission,
) -> Vec<&EnvironmentPermissionPolicy>
๐Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_policies_for_permission( &self, permission: Permission, ) -> Vec<&EnvironmentPermissionPolicy>
Will be extracted to mockforge-workspace crate
Get policies for a permission across all environments
Trait Implementationsยง
Auto Trait Implementationsยง
impl Freeze for EnvironmentPermissionChecker
impl RefUnwindSafe for EnvironmentPermissionChecker
impl Send for EnvironmentPermissionChecker
impl Sync for EnvironmentPermissionChecker
impl Unpin for EnvironmentPermissionChecker
impl UnsafeUnpin for EnvironmentPermissionChecker
impl UnwindSafe for EnvironmentPermissionChecker
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
Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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