Commit 7594f0a0 by Kálmán Viktor

dashboard: fix add port permissions

closes #437
parent dad93220
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<select class="form-control" name="proto" style="width: 70px;"><option>tcp</option><option>udp</option></select> <select class="form-control" name="proto" style="width: 70px;"><option>tcp</option><option>udp</option></select>
<div class="input-group-btn"> <div class="input-group-btn">
<button type="submit" class="btn btn-success btn-sm <button type="submit" class="btn btn-success btn-sm
{% if not is_operator %}disabled{% endif %}"> {% if not op.add_port %}disabled{% endif %}">
<span class="hidden-xs">{% trans "Add" %}</span> <span class="hidden-xs">{% trans "Add" %}</span>
<span class="visible-xs"><i class="fa fa-plus-circle"></i></span> <span class="visible-xs"><i class="fa fa-plus-circle"></i></span>
</button> </button>
......
...@@ -647,6 +647,7 @@ class AddPortOperation(InstanceOperation): ...@@ -647,6 +647,7 @@ class AddPortOperation(InstanceOperation):
name = _("open port") name = _("open port")
description = _("Open the specified port.") description = _("Open 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, host, proto, port): def _operation(self, activity, host, proto, port):
......
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