From 52fbe95e305e773d6d7715599bdaea971ee03132 Mon Sep 17 00:00:00 2001 From: "Ing. Jan Krcmar" Date: Tue, 9 Apr 2019 11:19:31 +0200 Subject: [PATCH] staff users are allowed to change vnc settings of instances --- instances/templates/instance.html | 4 ++-- instances/views.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/instances/templates/instance.html b/instances/templates/instance.html index da2865c..83b9ac8 100644 --- a/instances/templates/instance.html +++ b/instances/templates/instance.html @@ -537,7 +537,7 @@ {% endif %} - {% if request.user.is_superuser or userinstance.is_vnc %} + {% if request.user.is_superuser or request.user.is_staff or userinstance.is_vnc %}
  • {% trans "VNC" %} @@ -963,7 +963,7 @@
    {% endif %} - {% if request.user.is_superuser or userinstance.is_vnc %} + {% if request.user.is_superuser or request.user.is_staff or userinstance.is_vnc %}

    {% trans "To set console's type, shutdown the instance." %}

    {% csrf_token %} diff --git a/instances/views.py b/instances/views.py index ecea01b..67af348 100644 --- a/instances/views.py +++ b/instances/views.py @@ -645,7 +645,7 @@ def instance(request, compute_id, vname): addlogmsg(request.user.username, instance.name, msg) return HttpResponseRedirect(request.get_full_path() + '#xmledit') - if request.user.is_superuser or userinstance.is_vnc: + if request.user.is_superuser or request.user.is_staff or userinstance.is_vnc: if 'set_console_passwd' in request.POST: if request.POST.get('auto_pass', ''): passwd = randomPasswd()