Merge "Add correct policy for some actions" into stable/ocata

This commit is contained in:
Jenkins 2017-07-19 12:52:08 +00:00 committed by Gerrit Code Review
commit e109003b78
1 changed files with 9 additions and 1 deletions

View File

@ -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']