MCPcopy Index your code
hub / github.com/cloudfoundry/cli / SetSpaceRoleByGUID

Method SetSpaceRoleByGUID

cf/api/users.go:290–304  ·  view source on GitHub ↗
(userGUID, spaceGUID, orgGUID string, role models.Role)

Source from the content-addressed store, hash-verified

288}
289
290func (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
306func (repo CloudControllerUserRepository) SetSpaceRoleByUsername(username, spaceGUID, orgGUID string, role models.Role) (apiErr error) {
307 rolePath, apiErr := repo.checkSpaceRole(spaceGUID, role)

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
UpdateResourceMethod · 0.80
APIEndpointMethod · 0.65

Tested by

no test coverage detected