actix_web_grants::permissions

Trait AttachPermissions

source
pub trait AttachPermissions<Type> {
    // Required method
    fn attach(&self, permissions: Vec<Type>);
}
Expand description

Allows you to transfer permissions to actix-web-grants from your custom middleware.

The default implementation is provided for the ServiceRequest

§Example

use actix_web_grants::permissions::AttachPermissions;
use actix_web::dev::ServiceRequest;

// You can use you own type/enum instead of `String`
fn attach(req: &ServiceRequest, permissions: Vec<String>) {
    req.attach(permissions);
}

Required Methods§

source

fn attach(&self, permissions: Vec<Type>)

Implementations on Foreign Types§

source§

impl<Type: PartialEq + Clone + 'static> AttachPermissions<Type> for ServiceRequest

source§

fn attach(&self, permissions: Vec<Type>)

Implementors§