Commit 2be155b5 by Kálmán Viktor

dashboard: enable port closing for operators

and disable the remove button for non ops
parent 7594f0a0
...@@ -83,7 +83,8 @@ ...@@ -83,7 +83,8 @@
<span class="operation-wrapper"> <span class="operation-wrapper">
<a href="{{ op.remove_port.get_url }}?rule={{ l.ipv4.pk }}" <a href="{{ op.remove_port.get_url }}?rule={{ l.ipv4.pk }}"
class="btn btn-link btn-xs operation" class="btn btn-link btn-xs operation"
title="{% trans "Remove" %}"> title="{% trans "Remove" %}"
{% if not op.remove_port %}disabled{% endif %}>
<i class="fa fa-times"><span class="sr-only">{% trans "Remove" %}</span></i> <i class="fa fa-times"><span class="sr-only">{% trans "Remove" %}</span></i>
</a> </a>
</span> </span>
...@@ -118,7 +119,9 @@ ...@@ -118,7 +119,9 @@
{{ l.private }}/{{ l.proto }} {{ l.private }}/{{ l.proto }}
</td> </td>
<td> <td>
<a href="{{ op.remove_port.get_url }}?rule={{ l.ipv4.pk }}" class="btn btn-link btn-xs vm-details-remove-port" data-rule="{{ l.ipv6.pk }}" title="{% trans "Remove" %}"><i class="fa fa-times"><span class="sr-only">{% trans "Remove" %}</span></i></a> <a href="{{ op.remove_port.get_url }}?rule={{ l.ipv4.pk }}" class="btn btn-link btn-xs vm-details-remove-port" data-rule="{{ l.ipv6.pk }}" title="{% trans "Remove" %}" {% if not op.remove_port %}disabled{% endif %}>
<i class="fa fa-times"><span class="sr-only">{% trans "Remove" %}</span></i>
</a>
</td> </td>
</tr> </tr>
{% endif %} {% endif %}
......
...@@ -629,6 +629,7 @@ class RemovePortOperation(InstanceOperation): ...@@ -629,6 +629,7 @@ class RemovePortOperation(InstanceOperation):
name = _("close port") name = _("close port")
description = _("Close the specified port.") description = _("Close the specified port.")
concurrency_check = False concurrency_check = False
acl_level = "operator"
required_perms = ('vm.config_ports', ) required_perms = ('vm.config_ports', )
def _operation(self, activity, rule): def _operation(self, activity, rule):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment