Commit 3702c874 by Kálmán Viktor

dashboard: don't display change resource button if no perm

parent ba3fcdc2
......@@ -33,6 +33,7 @@
</div>
</p>
{% if can_change_resources %}
<p class="row">
<div class="col-sm-12">
<button type="submit" class="btn btn-success btn-sm enabled-when-stopped" id="vm-details-resources-save"
......@@ -42,6 +43,7 @@
</button>
</div>
</p>
{% endif %}
</form>
<hr />
......
......@@ -287,6 +287,10 @@ class VmDetailView(CheckedDetailView):
# ipv6 infos
context['ipv6_host'] = instance.get_connect_host(use_ipv6=True)
context['ipv6_port'] = instance.get_connect_port(use_ipv6=True)
# resources change perm
context['can_change_resources'] = self.request.user.has_perm(
"vm.change_resources")
return context
def post(self, request, *args, **kwargs):
......
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