| 772 | ) |
| 773 | |
| 774 | func (c *Client) WorkspaceACL(ctx context.Context, workspaceID uuid.UUID) (WorkspaceACL, error) { |
| 775 | res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/workspaces/%s/acl", workspaceID), nil) |
| 776 | if err != nil { |
| 777 | return WorkspaceACL{}, err |
| 778 | } |
| 779 | defer res.Body.Close() |
| 780 | if res.StatusCode != http.StatusOK { |
| 781 | return WorkspaceACL{}, ReadBodyAsError(res) |
| 782 | } |
| 783 | var acl WorkspaceACL |
| 784 | return acl, json.NewDecoder(res.Body).Decode(&acl) |
| 785 | } |
| 786 | |
| 787 | type UpdateWorkspaceACL struct { |
| 788 | // UserRoles is a mapping from valid user UUIDs to the workspace role they |