This patch fixes default policies for the Security Group Rules API so
that user of the project who isn't owner of the SG but only sees it
as shared one, can't now create or delete rules in such SG.
Additionally this patch lowers numer of retries when parent object's id
is looked up in the DB by the OwnerCheck policy rule to just one. If it
will fail twice with NotFound exception, then there is no need to repeat
it more times.
Reviewed: https:/ /review. opendev. org/c/openstack /neutron/ +/944200 /opendev. org/openstack/ neutron/ commit/ be59c0c0f1aa101 795dd7f06a6a8b2 09d46403bb
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/2023.2
commit be59c0c0f1aa101 795dd7f06a6a8b2 09d46403bb
Author: Slawek Kaplonski <email address hidden>
Date: Tue Mar 11 11:48:57 2025 +0100
[S-RBAC] Fix policies for the SG rules API
This patch fixes default policies for the Security Group Rules API so
that user of the project who isn't owner of the SG but only sees it
as shared one, can't now create or delete rules in such SG.
Additionally this patch lowers numer of retries when parent object's id
is looked up in the DB by the OwnerCheck policy rule to just one. If it
will fail twice with NotFound exception, then there is no need to repeat
it more times.
Conflicts:
neutron/ tests/unit/ conf/policies/ test_security_ group.py
Closes-bug: #2101150 034548a5fa91998 0d02bacd91a f56d101f8a0cb16 8a02338d5c) c338ec6a5d13e58 5251a19046)
Change-Id: I23722d0ffabce0
(cherry picked from commit dfea81a4bf6aa62
(cherry picked from commit f23e6ca9f80b5ba