Skip to content
Snippets Groups Projects
Commit 9e7baa63 authored by Cam Saül's avatar Cam Saül
Browse files

Remove superuser checks from new endpoints :tophat:

parent fe16ad6f
No related branches found
No related tags found
No related merge requests found
......@@ -27,11 +27,10 @@
(check-404 (metric/retrieve-metric id)))
(defendpoint GET "/"
"Fetch all `Metrics`. You must be a superuser to do this."
"Fetch *all* `Metrics`."
[id]
(check-superuser)
(check-404 (-> (db/select Metric, :is_active true)
(hydrate :creator))))
(-> (db/select Metric, :is_active true)
(hydrate :creator)))
(defendpoint PUT "/:id"
......
......@@ -27,9 +27,8 @@
(check-404 (segment/retrieve-segment id)))
(defendpoint GET "/"
"Fetch *all* `Segments`. You must be a superuser."
"Fetch *all* `Segments`."
[]
(check-superuser)
(-> (db/select Segment, :is_active true)
(hydrate :creator)))
......
......@@ -329,9 +329,4 @@
Metric [_ {:is_active false}]] ; inactive metrics shouldn't show up
(tu/mappify (hydrate [metric-1
metric-2] :creator))
((user->client :crowberto) :get 200 "metric/"))
;; non-admin users shouldn't be allowed to use this endpoint -- should get a 403
(expect
"You don't have permissions to do that."
((user->client :rasta) :get 403 "metric/"))
((user->client :rasta) :get 200 "metric/"))
......@@ -334,9 +334,4 @@
Segment [_ {:is_active false}]] ; inactive segments shouldn't show up
(tu/mappify (hydrate [segment-1
segment-2] :creator))
((user->client :crowberto) :get 200 "segment/"))
;; non-admin users shouldn't be allowed to use this endpoint -- should get a 403
(expect
"You don't have permissions to do that."
((user->client :rasta) :get 403 "segment/"))
((user->client :rasta) :get 200 "segment/"))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment