Skip to content

Commit 7e24127

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "[S-RBAC] Fix policies for l3_conntrack_helpers" into stable/2025.1
2 parents 126a22b + d7f1a89 commit 7e24127

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

neutron/conf/policies/l3_conntrack_helper.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
rules = [
3131
policy.DocumentedRuleDefault(
3232
name='create_router_conntrack_helper',
33-
check_str=neutron_policy.policy_or(
34-
base.ADMIN_OR_PROJECT_MEMBER,
35-
base.PARENT_OWNER_MEMBER),
33+
check_str=base.ADMIN_OR_PARENT_OWNER_MEMBER,
3634
scope_types=['project'],
3735
description='Create a router conntrack helper',
3836
operations=[
@@ -49,9 +47,7 @@
4947
),
5048
policy.DocumentedRuleDefault(
5149
name='get_router_conntrack_helper',
52-
check_str=neutron_policy.policy_or(
53-
base.ADMIN_OR_PROJECT_READER,
54-
base.PARENT_OWNER_READER),
50+
check_str=base.ADMIN_OR_PARENT_OWNER_READER,
5551
scope_types=['project'],
5652
description='Get a router conntrack helper',
5753
operations=[
@@ -72,9 +68,7 @@
7268
),
7369
policy.DocumentedRuleDefault(
7470
name='update_router_conntrack_helper',
75-
check_str=neutron_policy.policy_or(
76-
base.ADMIN_OR_PROJECT_MEMBER,
77-
base.PARENT_OWNER_MEMBER),
71+
check_str=base.ADMIN_OR_PARENT_OWNER_MEMBER,
7872
scope_types=['project'],
7973
description='Update a router conntrack helper',
8074
operations=[
@@ -91,9 +85,7 @@
9185
),
9286
policy.DocumentedRuleDefault(
9387
name='delete_router_conntrack_helper',
94-
check_str=neutron_policy.policy_or(
95-
base.ADMIN_OR_PROJECT_MEMBER,
96-
base.PARENT_OWNER_MEMBER),
88+
check_str=base.ADMIN_OR_PARENT_OWNER_MEMBER,
9789
scope_types=['project'],
9890
description='Delete a router conntrack helper',
9991
operations=[

neutron/tests/unit/conf/policies/test_l3_conntrack_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ def setUp(self):
2828
super().setUp()
2929
self.router = {
3030
'id': uuidutils.generate_uuid(),
31+
'tenant_id': self.project_id,
3132
'project_id': self.project_id}
3233
self.alt_router = {
3334
'id': uuidutils.generate_uuid(),
35+
'tenant_id': self.alt_project_id,
3436
'project_id': self.alt_project_id}
3537

3638
self.target = {
37-
'project_id': self.project_id,
3839
'router_id': self.router['id'],
3940
'ext_parent_router_id': self.router['id']}
4041
self.alt_target = {
41-
'project_id': self.alt_project_id,
4242
'router_id': self.alt_router['id'],
4343
'ext_parent_router_id': self.alt_router['id']}
4444

0 commit comments

Comments
 (0)