diff --git a/openstack_dashboard/conf/nova_policy.json b/openstack_dashboard/conf/nova_policy.json index b6b460fd75..9199fdf1a7 100644 --- a/openstack_dashboard/conf/nova_policy.json +++ b/openstack_dashboard/conf/nova_policy.json @@ -26,6 +26,7 @@ "os_compute_api:os-assisted-volume-snapshots:delete": "rule:admin_api", "os_compute_api:os-assisted-volume-snapshots:discoverable": "@", "os_compute_api:os-attach-interfaces": "rule:admin_or_owner", + "os_compute_api:os-attach-interfaces:delete": "rule:admin_or_owner", "os_compute_api:os-attach-interfaces:discoverable": "@", "os_compute_api:os-availability-zone:list": "rule:admin_or_owner", "os_compute_api:os-availability-zone:discoverable": "@", diff --git a/openstack_dashboard/dashboards/project/instances/tables.py b/openstack_dashboard/dashboards/project/instances/tables.py index 211b9ca8da..b398fc1d50 100644 --- a/openstack_dashboard/dashboards/project/instances/tables.py +++ b/openstack_dashboard/dashboards/project/instances/tables.py @@ -958,13 +958,12 @@ class AttachInterface(policy.PolicyTargetMixin, tables.LinkAction): return urlresolvers.reverse(self.url, args=[instance_id]) -# TODO(lyj): the policy for detach interface not exists in nova.json, -# once it's added, it should be added here. class DetachInterface(policy.PolicyTargetMixin, tables.LinkAction): name = "detach_interface" verbose_name = _("Detach Interface") classes = ("btn-confirm", "ajax-modal") url = "horizon:project:instances:detach_interface" + policy_rules = (("compute", "os_compute_api:os-attach-interfaces:delete"),) def allowed(self, request, instance): if not api.base.is_service_enabled(request, 'network'):