Merge "Implement secure RBAC for floating IP pools API"

This commit is contained in:
Zuul 2021-01-27 04:04:43 +00:00 committed by Gerrit Code Review
commit 51e0572315
1 changed files with 14 additions and 5 deletions

View File

@ -10,22 +10,31 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo_log import versionutils
from oslo_policy import policy from oslo_policy import policy
from neutron.conf.policies import base from neutron.conf.policies import base
DEPRECATED_REASON = (
"The Floating IP Pool API now supports system scope and default roles.")
rules = [ rules = [
policy.DocumentedRuleDefault( policy.DocumentedRuleDefault(
'get_floatingip_pool', name='get_floatingip_pool',
base.RULE_ANY, check_str=base.SYSTEM_OR_PROJECT_READER,
'Get floating IP pools', description='Get floating IP pools',
[ operations=[
{ {
'method': 'GET', 'method': 'GET',
'path': '/floatingip_pools', 'path': '/floatingip_pools',
}, },
] ],
scope_types=['admin', 'project'],
deprecated_rule=policy.DeprecatedRule(
name='get_floatingip_pool',
check_str=base.RULE_ANY),
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
), ),
] ]