From 052610dd215b761399577b6d555ecdc5b90a0536 Mon Sep 17 00:00:00 2001 From: Info-IIG Date: Thu, 16 Jun 2022 14:55:08 +0200 Subject: [PATCH] Added permission can snapshot instances --- instances/models.py | 1 + instances/templates/instance.html | 2 +- instances/views.py | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/instances/models.py b/instances/models.py index 5d4f021..147b099 100644 --- a/instances/models.py +++ b/instances/models.py @@ -216,6 +216,7 @@ class PermissionSet(models.Model): ('clone_instances', 'Can clone instances'), ('passwordless_console', _('Can access console without password')), ('view_instances', 'Can view instances'), + ('snapshot_instances', 'Can snapshot instances'), ] managed = False diff --git a/instances/templates/instance.html b/instances/templates/instance.html index a1b88b4..cb18556 100644 --- a/instances/templates/instance.html +++ b/instances/templates/instance.html @@ -93,7 +93,7 @@ {% trans "Resize" %} - {% if allow_admin_or_not_template %} + {% if allow_admin_or_not_template and 'instances.snapshot_instances' in perms %}