From 2ef672ffb51a4abdbf8f4f2029214afc1aea01b2 Mon Sep 17 00:00:00 2001 From: "Ing. Jan KRCMAR" Date: Thu, 5 Oct 2017 07:58:01 +0200 Subject: [PATCH] user.is_staff can do resize of all machines --- instances/templates/instance.html | 2 +- instances/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instances/templates/instance.html b/instances/templates/instance.html index 8e26148..39e9b7e 100644 --- a/instances/templates/instance.html +++ b/instances/templates/instance.html @@ -318,7 +318,7 @@
- {% if request.user.is_superuser or userinstace.is_change %} + {% if request.user.is_superuser or request.user.is_staff or userinstace.is_change %}
{% csrf_token %}

{% trans "Logical host CPUs:" %} {{ vcpu_host }}

diff --git a/instances/views.py b/instances/views.py index 14b4eae..45b661a 100644 --- a/instances/views.py +++ b/instances/views.py @@ -446,7 +446,7 @@ def instance(request, compute_id, vname): msg = _("Please shutdow down your instance and then try again") error_messages.append(msg) - if 'resize' in request.POST and (request.user.is_superuser or userinstace.is_change): + if 'resize' in request.POST and (request.user.is_superuser or request.user.is_staff or userinstace.is_change): new_vcpu = request.POST.get('vcpu', '') new_cur_vcpu = request.POST.get('cur_vcpu', '') new_memory = request.POST.get('memory', '')