use of cwms.radar.security.Role in project cwms-radar-api by USACE.
the class ApiServlet method configureRoutes.
protected void configureRoutes() {
RouteRole[] requiredRoles = { new Role(CWMS_USERS_ROLE) };
get("/", ctx -> ctx.result("Welcome to the CWMS REST API").contentType(Formats.PLAIN));
radarCrud("/location/category/{category-id}", new LocationCategoryController(metrics), requiredRoles);
radarCrud("/location/group/{group-id}", new LocationGroupController(metrics), requiredRoles);
radarCrud("/locations/{location_code}", new LocationController(metrics), requiredRoles);
radarCrud("/offices/{office}", new OfficeController(metrics), requiredRoles);
radarCrud("/units/{unit_name}", new UnitsController(metrics), requiredRoles);
radarCrud("/parameters/{param_name}", new ParametersController(metrics), requiredRoles);
radarCrud("/timezones/{zone}", new TimeZoneController(metrics), requiredRoles);
radarCrud("/levels/{location}", new LevelsController(metrics), requiredRoles);
TimeSeriesController tsController = new TimeSeriesController(metrics);
get("/timeseries/recent/{group-id}", tsController::getRecent);
radarCrud("/timeseries/category/{category-id}", new TimeSeriesCategoryController(metrics), requiredRoles);
radarCrud("/timeseries/group/{group-id}", new TimeSeriesGroupController(metrics), requiredRoles);
radarCrud("/timeseries/{timeseries}", tsController, requiredRoles);
radarCrud("/ratings/{rating}", new RatingController(metrics), requiredRoles);
radarCrud("/catalog/{dataSet}", new CatalogController(metrics), requiredRoles);
radarCrud("/basins/{basin-id}", new BasinController(metrics), requiredRoles);
radarCrud("/blobs/{blob-id}", new BlobController(metrics), requiredRoles);
radarCrud("/clobs/{clob-id}", new ClobController(metrics), requiredRoles);
radarCrud("/pools/{pool-id}", new PoolController(metrics), requiredRoles);
}
Aggregations