[][src]Attribute Macro actix_grants_proc_macro::has_authorities

#[has_authorities]

Macro to сheck that the user has all the specified authorities.

Examples

use actix_web_grants::proc_macro::has_authorities;
use actix_web::HttpResponse;

// User should be ADMIN with OP_GET_SECRET permission
#[has_authorities["ROLE_ADMIN", "OP_GET_SECRET"]]
async fn macro_secured() -> HttpResponse {
    HttpResponse::Ok().body("some secured info")
}