5df6e93b59
This reverts commit a014720912
.
Reason for revert: It is not needed to have network in the EXT_PARENT_RESOURCE_MAPPING as we will keep NET_OWNER rules and use
them for subnets and ports API.
Please see [1] for more detailed explanation why it's better to keep NET_OWNER rules for those policies.
[1] https://review.opendev.org/c/openstack/neutron/+/889153
Change-Id: Ia2cd6301e04ac502888ee2b8042ea8c19873a95a
35 lines
1.5 KiB
Python
35 lines
1.5 KiB
Python
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
from neutron_lib.api.definitions import l3
|
|
from neutron_lib.api.definitions import local_ip
|
|
from neutron_lib.api.definitions import qos
|
|
from neutron_lib.plugins import constants as plugin_const
|
|
|
|
|
|
# Registered extension parent resource check mapping
|
|
# If we want to register some service plugin resources into policy and check
|
|
# the owner when operating their subresources. We can write here to use
|
|
# existing policy engine for parent resource owner check.
|
|
# Each entry here should be PARENT_RESOURCE_NAME: SERVICE_PLUGIN_NAME,
|
|
# PARENT_RESOURCE_NAME is usually from api definition.
|
|
# SERVICE_PLUGIN_NAME is the service plugin which introduced the resource and
|
|
# registered the service plugin name in neutron-lib.
|
|
EXT_PARENT_RESOURCE_MAPPING = {
|
|
l3.FLOATINGIP: plugin_const.L3,
|
|
l3.ROUTER: plugin_const.CONNTRACKHELPER,
|
|
local_ip.RESOURCE_NAME: plugin_const.LOCAL_IP,
|
|
qos.POLICY: plugin_const.QOS,
|
|
}
|