(userGUID, spaceGUID, orgGUID string, role models.Role)
| 288 | } |
| 289 | |
| 290 | func (repo CloudControllerUserRepository) SetSpaceRoleByGUID(userGUID, spaceGUID, orgGUID string, role models.Role) error { |
| 291 | rolePath, found := spaceRoleToPathMap[role] |
| 292 | if !found { |
| 293 | return errors.New(T("Invalid Role {{.Role}}", map[string]interface{}{"Role": role})) |
| 294 | } |
| 295 | |
| 296 | err := repo.assocUserWithOrgByUserGUID(userGUID, orgGUID) |
| 297 | if err != nil { |
| 298 | return err |
| 299 | } |
| 300 | |
| 301 | path := fmt.Sprintf("/v2/spaces/%s/%s/%s", spaceGUID, rolePath, userGUID) |
| 302 | |
| 303 | return repo.ccGateway.UpdateResource(repo.config.APIEndpoint(), path, nil) |
| 304 | } |
| 305 | |
| 306 | func (repo CloudControllerUserRepository) SetSpaceRoleByUsername(username, spaceGUID, orgGUID string, role models.Role) (apiErr error) { |
| 307 | rolePath, apiErr := repo.checkSpaceRole(spaceGUID, role) |
nothing calls this directly
no test coverage detected