✨ (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:
Manuel Cillero 2026-11-07 13:52:04 +01:00
parent 71ea609088
commit ab2677be44
28 changed files with 664 additions and 158 deletions

View file

@ -18,15 +18,15 @@ struct ActionExtension;
#[async_trait]
impl Extension for ActionExtension {
fn configure_router(&self, router: Router) -> Router {
router.route(
fn configure_router(&self, routes: Routes) -> Routes {
routes.public_route(
"/action/{name}",
web::get(|| async { "read" }).post(|| async { "done" }),
)
}
fn configure_middleware(&self, router: Router) -> Router {
router.layer(web::middleware::from_fn(record_path))
fn configure_middleware(&self, layers: Layers) -> Layers {
layers.layer(web::middleware::from_fn(record_path))
}
}