Overview
The Editor role is designed for content creators who manage tourist routes and destination visibility. Editors can create, update, and delete routes, as well as toggle destination active/inactive status.The editor role is identified as
"editor" in the database and code.Core Capabilities
Editors have access to two primary domains:Route Management
Full CRUD operations on tourist routes
Destination Status
Enable or disable destination visibility
Route Management
Editors have complete control over tourist routes:Create Routes
Editors can create new tourist routes with multiple POIs:POST /rutas/crearSource:
src/infrastructure/api/routers/rutas_router.py:30-44
Required Fields:
nombre(string): Route namepois(array): List of POI objects withpoi_id
descripcion(string): Route descriptioncategoria(string): Route category
Update Routes
Editors can modify existing routes:PUT /rutas/{ruta_id}Source:
src/infrastructure/api/routers/rutas_router.py:104-129
Delete Routes
Editors can remove routes from the system:DELETE /rutas/{ruta_id}Source:
src/infrastructure/api/routers/rutas_router.py:76-85
Destination Status Management
Editors can toggle destination visibility without full editing permissions:Toggle Destination Status
PUT /destinos/estado/{id}Source:
src/infrastructure/api/routers/destinos_router.py:46-54
This endpoint toggles the destination’s active status. If active, it becomes inactive, and vice versa.
Read-Only Permissions
Editors can view (but not create, edit, or delete) destinations:Browse Destinations
GET /destinos/Source:
src/infrastructure/api/routers/destinos_router.py:30-34
View Routes
Editors can view all routes and route details:GET /rutas/- List all routesGET /rutas/{ruta_id}- Get route details
src/infrastructure/api/routers/rutas_router.py:50-70
Inherited Visitor Permissions
Editors inherit all visitor capabilities:Favorites
Add and remove favorite destinations
Tracking
Register visited POIs and completed routes
Profile
View and update personal profile
AI Features
Generate routes and get POI suggestions
Permission Enforcement
Therequire_editor dependency ensures only editors and administrators can access protected endpoints:
src/infrastructure/security/jwt_utils.py:95-99
Administrators automatically have all editor permissions through role inheritance.
Editor-Only Endpoints
The following endpoints require editor or administrator privileges:| Endpoint | Method | Purpose |
|---|---|---|
/rutas/crear | POST | Create new route |
/rutas/{ruta_id} | PUT | Update route |
/rutas/{ruta_id} | DELETE | Delete route |
/destinos/estado/{id} | PUT | Toggle destination status |
Prohibited Operations
Editors cannot perform the following operations (admin-only):Common Workflows
Creating a Complete Route
- Browse available destinations via
GET /destinos/ - Identify POIs to include in the route
- Create the route via
POST /rutas/crearwith POI IDs - Optionally update the route via
PUT /rutas/{ruta_id}
Managing Destination Visibility
- Identify destination via
GET /destinos/ - Toggle status via
PUT /destinos/estado/{id} - Verify change by checking destination list
Best Practices
Route Creation Tips:
- Use descriptive names and detailed descriptions
- Order POIs logically for optimal visitor experience
- Assign appropriate categories for filtering
- Test routes by viewing them as a visitor