(username string, orgGUID string, role models.Role)
| 253 | } |
| 254 | |
| 255 | func (repo CloudControllerUserRepository) SetOrgRoleByUsername(username string, orgGUID string, role models.Role) error { |
| 256 | rolePath, err := rolePath(role) |
| 257 | if err != nil { |
| 258 | return err |
| 259 | } |
| 260 | |
| 261 | path := fmt.Sprintf("%s/v2/organizations/%s/%s", repo.config.APIEndpoint(), orgGUID, rolePath) |
| 262 | err = repo.callAPI("PUT", path, usernamePayload(username)) |
| 263 | if err != nil { |
| 264 | return err |
| 265 | } |
| 266 | return repo.assocUserWithOrgByUsername(username, orgGUID, nil) |
| 267 | } |
| 268 | |
| 269 | func (repo CloudControllerUserRepository) callAPI(verb, path string, body io.ReadSeeker) (err error) { |
| 270 | request, err := repo.ccGateway.NewRequest(verb, path, repo.config.AccessToken(), body) |
nothing calls this directly
no test coverage detected