pub struct AuthzEngine { /* private fields */ }Implementations§
Source§impl AuthzEngine
impl AuthzEngine
pub fn new() -> Self
pub fn add_policy(&mut self, policy: impl Policy)
Sourcepub async fn enforce(
&self,
action: &str,
identity: &Identity,
resource_id: Option<&str>,
) -> Result<()>
pub async fn enforce( &self, action: &str, identity: &Identity, resource_id: Option<&str>, ) -> Result<()>
Enforces authorization. Raises AuthError::Forbidden if denied.
Evaluation order:
- Walk policies in registration order.
- First explicit Allow → permit.
- First explicit Deny → reject.
- All Abstain → fall through to RBAC check.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuthzEngine
impl !RefUnwindSafe for AuthzEngine
impl Send for AuthzEngine
impl Sync for AuthzEngine
impl Unpin for AuthzEngine
impl UnsafeUnpin for AuthzEngine
impl !UnwindSafe for AuthzEngine
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