chore: change view perm to use (#4496)

This commit is contained in:
Jon Ayers
2022-10-12 14:33:21 -05:00
committed by GitHub
parent 47805643f7
commit 0fa8f528c2
7 changed files with 39 additions and 33 deletions

View File

@ -420,6 +420,7 @@ func (api *API) fetchTemplateVersionDryRunJob(rw http.ResponseWriter, r *http.Re
httpapi.Forbidden(rw)
return database.ProvisionerJob{}, false
}
// Do a workspace resource check since it's basically a workspace dry-run .
if !api.Authorize(r, rbac.ActionRead,
rbac.ResourceWorkspace.InOrg(templateVersion.OrganizationID).WithOwner(job.InitiatorID.String())) {