Skip to content

Commit 90e6a9d

Browse files
committed
fix existing tests
1 parent a9f04f3 commit 90e6a9d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

coderd/templates.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,16 @@ func (api *API) templateDAUs(rw http.ResponseWriter, r *http.Request) {
565565
httpapi.Write(ctx, rw, http.StatusOK, resp)
566566
}
567567

568-
func (*API) templateExamples(rw http.ResponseWriter, r *http.Request) {
569-
ctx := r.Context()
568+
func (api *API) templateExamples(rw http.ResponseWriter, r *http.Request) {
569+
var (
570+
ctx = r.Context()
571+
organization = httpmw.OrganizationParam(r)
572+
)
573+
574+
if !api.Authorize(r, rbac.ActionRead, rbac.ResourceTemplate.InOrg(organization.ID)) {
575+
httpapi.ResourceNotFound(rw)
576+
return
577+
}
570578

571579
ex, err := examples.List()
572580
if err != nil {

0 commit comments

Comments
 (0)