From ec08e895b5ef4317518a03dc4e1494e825b3f299 Mon Sep 17 00:00:00 2001 From: Drew Dara-Abrams Date: Mon, 30 Oct 2023 11:23:59 -0700 Subject: [PATCH] separate auth roles for downloading current FV and historic FVs --- server/rest/rest.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/rest/rest.go b/server/rest/rest.go index 49624907..bb970f38 100644 --- a/server/rest/rest.go +++ b/server/rest/rest.go @@ -55,14 +55,14 @@ func NewServer(cfg config.Config, srv http.Handler) (http.Handler, error) { r.HandleFunc("/feeds", feedHandler) r.HandleFunc("/feeds/{feed_key}.{format}", feedHandler) r.HandleFunc("/feeds/{feed_key}", feedHandler) - r.HandleFunc("/feeds/{feed_key}/download_latest_feed_version", makeHandlerFunc(restcfg, "feedVersionDownloadLatest", feedVersionDownloadLatestHandler)) + r.HandleFunc("/feeds/{feed_key}/download_latest_feed_version", ancheck.RoleRequired("tl_download_fv_current")(makeHandlerFunc(restcfg, "feedVersionDownloadLatest", feedVersionDownloadLatestHandler))) r.HandleFunc("/feed_versions.{format}", feedVersionHandler) r.HandleFunc("/feed_versions", feedVersionHandler) r.HandleFunc("/feed_versions/{feed_version_key}.{format}", feedVersionHandler) r.HandleFunc("/feed_versions/{feed_version_key}", feedVersionHandler) r.HandleFunc("/feeds/{feed_key}/feed_versions", feedVersionHandler) - r.Handle("/feed_versions/{feed_version_key}/download", ancheck.RoleRequired("tl_user_pro")(makeHandlerFunc(restcfg, "feedVersionDownload", feedVersionDownloadHandler))) + r.Handle("/feed_versions/{feed_version_key}/download", ancheck.RoleRequired("tl_download_fv_historic")(makeHandlerFunc(restcfg, "feedVersionDownload", feedVersionDownloadHandler))) r.HandleFunc("/agencies.{format}", agencyHandler) r.HandleFunc("/agencies", agencyHandler)