Add correct policy for some actions
This patch correct the wrong policy for add allowed address pair
and add policy for delete allowed address pair.
Closes-Bug:
@@ -36,7 +36,10 @@ class AddAllowedAddressPair(policy.PolicyTargetMixin, tables.LinkAction):
url = "horizon:project:networks:ports:addallowedaddresspairs"
classes = ("ajax-modal",)
icon = "plus"
- policy_rules = (("network", "update_port"),)
+ policy_rules = (
+ ("network", "update_port"),
+ ("network", "update_port:allowed_address_pairs"),
+ )
def get_link_url(self, port=None):
if port:
@@ -62,6 +65,11 @@ class DeleteAllowedAddressPair(tables.DeleteAction):
count
)
+ policy_rules = (
+ ("network", "update_port"),
+ ("network", "update_port:allowed_address_pairs"),
+ )
+
def delete(self, request, ip_address):
try:
port_id = self.table.kwargs['port_id']
