rskit-authz 0.2.0-alpha.3

RBAC and ABAC authorization engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Lightweight authorization traits.

use crate::engine::{Decision, Request};

/// Policy enforcement point for authorization checks.
pub trait Checker: Send + Sync {
    /// Evaluate a request and return the full decision.
    fn authorize(&self, request: &Request) -> Decision;

    /// Return `true` when the request is allowed.
    fn check(&self, request: &Request) -> bool {
        self.authorize(request).allowed
    }
}