✨ (web): Exige el acceso de cada ruta al montarla
`configure_router()` recibe Routes, que no monta ninguna ruta sin su Access: `route()`, `public_route()` y `admin_route()`, que toma el permiso de la página del panel de la que cuelga. Una ruta del panel montada de otra forma impide arrancar. `configure_middleware()` recibe Layers y `configure_static_files()` recibe StaticFiles, siempre públicos.
This commit is contained in:
parent
71ea609088
commit
ab2677be44
28 changed files with 664 additions and 158 deletions
|
|
@ -6,15 +6,15 @@ struct FlashExtension;
|
|||
|
||||
#[async_trait]
|
||||
impl Extension for FlashExtension {
|
||||
fn configure_router(&self, router: Router) -> Router {
|
||||
router
|
||||
.route("/save", web::post(save))
|
||||
.route(
|
||||
fn configure_router(&self, routes: Routes) -> Routes {
|
||||
routes
|
||||
.public_route("/save", web::post(save))
|
||||
.public_route(
|
||||
"/again",
|
||||
web::get(|| async { Redirect::see_other("/done") }),
|
||||
)
|
||||
.route("/done", web::get(done))
|
||||
.route("/file", web::get(|| async { "plain text" }))
|
||||
.public_route("/done", web::get(done))
|
||||
.public_route("/file", web::get(|| async { "plain text" }))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue