[][src]Attribute Macro actix_grants_proc_macro::has_any_role

#[has_any_role]

Macro to сheck that the user has any the specified roles. Role - is authority with prefix "ROLE_".

Examples

use actix_web_grants::proc_macro::has_any_role;
use actix_web::HttpResponse;

// User should be ADMIN or MANAGER
#[has_any_role["ADMIN", "MANAGER"]]
async fn macro_secured() -> HttpResponse {
    HttpResponse::Ok().body("some secured info")
}