Skip to content

Commit

Permalink
Make External-facing networks available to all tenants
Browse files Browse the repository at this point in the history
External-facing networks, at least in Openstack, are supposed
to be scoped to all tenants. This updates the tenant_id
clause for CloudNetworks to consider whether external_facing
is true when deciding whether to allow a tenant to see a network.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1779536
  • Loading branch information
mansam committed Jan 29, 2020
1 parent 5a86129 commit 1eab9ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/cloud_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def self.class_by_ems(ext_management_system, _external = false)
end

def self.tenant_id_clause_format(tenant_ids)
["((tenants.id IN (?) OR cloud_networks.shared IS TRUE) AND ext_management_systems.tenant_mapping_enabled IS TRUE) OR ext_management_systems.tenant_mapping_enabled IS FALSE OR ext_management_systems.tenant_mapping_enabled IS NULL", tenant_ids]
["((tenants.id IN (?) OR cloud_networks.shared IS TRUE OR cloud_networks.external_facing IS TRUE) AND ext_management_systems.tenant_mapping_enabled IS TRUE) OR ext_management_systems.tenant_mapping_enabled IS FALSE OR ext_management_systems.tenant_mapping_enabled IS NULL", tenant_ids]
end

private
Expand Down

0 comments on commit 1eab9ac

Please sign in to comment.