Commit fa1e0e22 by Őry Máté

dashboard: add permissions

parent c529f9c6
......@@ -7,9 +7,11 @@
<div class="body-content dashboard-index">
<div class="row">
{% if perms.vm %}
<div class="col-lg-4 col-md-6">
{% include "dashboard/index-vm.html" %}
</div>
{% endif %}
<div class="col-lg-4 col-md-6">
{% include "dashboard/index-groups.html" %}
......@@ -19,13 +21,17 @@
{% include "dashboard/index-files.html" %}
</div>
{% if perms.vm.create_template %}
<div class="col-lg-4 col-md-6">
{% include "dashboard/index-templates.html" %}
</div>
{% endif %}
{% if user.is_superuser %}
<div class="col-lg-4 col-md-6">
{% include "dashboard/index-nodes.html" %}
</div>
{% endif %}
</div>
</div>
{% endblock %}
......
......@@ -117,7 +117,9 @@ class InstanceTemplate(VirtualMachineDescModel, TimeStampedModel):
app_label = 'vm'
db_table = 'vm_instancetemplate'
ordering = ['name', ]
permissions = ()
permissions = (
('create_template', _('Can create an instance template.')),
)
verbose_name = _('template')
verbose_name_plural = _('templates')
......
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