Commit fa1e0e22 by Őry Máté

dashboard: add permissions

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