Skip to content

Commit fe0741b

Browse files
committed
feat: add DeleteWorkspaceACL method to client
1 parent 66d05d7 commit fe0741b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

codersdk/workspaces.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,18 @@ func (c *Client) UpdateWorkspaceACL(ctx context.Context, workspaceID uuid.UUID,
722722
return nil
723723
}
724724

725+
func (c *Client) DeleteWorkspaceACL(ctx context.Context, workspaceID uuid.UUID) error {
726+
res, err := c.Request(ctx, http.MethodDelete, fmt.Sprintf("/api/v2/workspaces/%s/acl", workspaceID), nil)
727+
if err != nil {
728+
return err
729+
}
730+
defer res.Body.Close()
731+
if res.StatusCode != http.StatusNoContent {
732+
return ReadBodyAsError(res)
733+
}
734+
return nil
735+
}
736+
725737
// ExternalAgentCredentials contains the credentials needed for an external agent to connect to Coder.
726738
type ExternalAgentCredentials struct {
727739
Command string `json:"command"`

0 commit comments

Comments
 (0)