Commit 3702c874 by Kálmán Viktor

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

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