Skip to main content

authorize

Attribute Macro authorize 

Source
#[authorize]
Expand description

Declares authorization requirements on a route.

#[get("/api/users")]
#[authorize(role = "admin")]
impl IRequest<Vec<UserModel>> for ListUsersRequest {}

#[get("/api/auth/me")]
#[authorize]
impl IRequest<UserView> for AuthMeRequest {}