MCPcopy Create free account
hub / github.com/coder/coder / TemplateACL

Method TemplateACL

codersdk/templates.go:402–413  ·  view source on GitHub ↗
(ctx context.Context, templateID uuid.UUID)

Source from the content-addressed store, hash-verified

400}
401
402func (c *Client) TemplateACL(ctx context.Context, templateID uuid.UUID) (TemplateACL, error) {
403 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/templates/%s/acl", templateID), nil)
404 if err != nil {
405 return TemplateACL{}, err
406 }
407 defer res.Body.Close()
408 if res.StatusCode != http.StatusOK {
409 return TemplateACL{}, ReadBodyAsError(res)
410 }
411 var acl TemplateACL
412 return acl, json.NewDecoder(res.Body).Decode(&acl)
413}
414
415// UpdateActiveTemplateVersion updates the active template version to the ID provided.
416// The template version must be attached to the template.

Callers 5

TestCreateWorkspaceFunction · 0.80
TestCreateUserWorkspaceFunction · 0.80
TestTemplateACLFunction · 0.80
TestUpdateTemplateACLFunction · 0.80
TestTemplateEditFunction · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 5

TestCreateWorkspaceFunction · 0.64
TestCreateUserWorkspaceFunction · 0.64
TestTemplateACLFunction · 0.64
TestUpdateTemplateACLFunction · 0.64
TestTemplateEditFunction · 0.64