Trait AuthorizationService

Source
pub trait AuthorizationService<S: Subject>:
    Send
    + Sync
    + Sized
    + Clone
    + 'static
    + Send {
    // Required method
    fn authorize(
        &self,
        subject: &S,
        relation: &str,
        object: &str,
    ) -> impl Future<Output = Result<()>> + Send;
}
Expand description

Authorization service

Required Methods§

Source

fn authorize( &self, subject: &S, relation: &str, object: &str, ) -> impl Future<Output = Result<()>> + Send

Validates if the subject is allowed to perform the relation on the object

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<S: Subject, T: AuthorizationService<S> + ?Sized> AuthorizationService<S> for Box<T>
where Box<T>: Send + Sync + Sized + Clone + 'static,

Source§

async fn authorize( &self, subject: &S, relation: &str, object: &str, ) -> Result<()>

Source§

impl<S: Subject, T: AuthorizationService<S> + ?Sized> AuthorizationService<S> for Arc<T>
where Arc<T>: Send + Sync + Sized + Clone + 'static,

Source§

async fn authorize( &self, subject: &S, relation: &str, object: &str, ) -> Result<()>

Implementors§