MCPcopy Create free account
hub / github.com/cloudfoundry/cli / disableOrganizationServiceAccess

Method disableOrganizationServiceAccess

actor/v7action/service_access.go:212–242  ·  view source on GitHub ↗
(plans []resources.ServicePlan, orgName string)

Source from the content-addressed store, hash-verified

210}
211
212func (actor *Actor) disableOrganizationServiceAccess(plans []resources.ServicePlan, orgName string) (SkippedPlans, Warnings, error) {
213 var allWarnings Warnings
214
215 org, orgWarnings, err := actor.GetOrganizationByName(orgName)
216 allWarnings = append(allWarnings, orgWarnings...)
217 if err != nil {
218 return nil, allWarnings, err
219 }
220
221 for _, plan := range plans {
222 if plan.VisibilityType == resources.ServicePlanVisibilityPublic {
223 return nil, allWarnings, errors.New("Cannot remove organization level access for public plans.")
224 }
225 }
226
227 var skipped SkippedPlans
228 for _, plan := range plans {
229 if plan.VisibilityType == resources.ServicePlanVisibilityAdmin {
230 skipped = append(skipped, plan.Name)
231 continue
232 }
233
234 deleteWarnings, err := actor.CloudControllerClient.DeleteServicePlanVisibility(plan.GUID, org.GUID)
235 allWarnings = append(allWarnings, deleteWarnings...)
236 if err != nil {
237 return skipped, allWarnings, err
238 }
239 }
240
241 return skipped, allWarnings, nil
242}
243
244func (actor *Actor) getServiceOfferings(service, broker string) (map[string]offeringDetails, Warnings, error) {
245 var offeringsQuery []ccv3.Query

Callers 1

DisableServiceAccessMethod · 0.95

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 2

GetOrganizationByNameMethod · 0.95

Tested by

no test coverage detected