(plans []resources.ServicePlan, orgName string)
| 210 | } |
| 211 | |
| 212 | func (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 | |
| 244 | func (actor *Actor) getServiceOfferings(service, broker string) (map[string]offeringDetails, Warnings, error) { |
| 245 | var offeringsQuery []ccv3.Query |
no test coverage detected