Attribute Macro actix_web_grants::proc_macro::has_permissions[][src]

#[has_permissions]
Expand description

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

Examples

use actix_web_grants::proc_macro::has_permissions;
use actix_web::HttpResponse;

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