diff --git a/machines/models.py b/machines/models.py index f2118e84..ab17217b 100644 --- a/machines/models.py +++ b/machines/models.py @@ -1367,7 +1367,7 @@ class Domain(models.Model): :return: soit True, soit False avec la raison de l'échec""" if not user_request.has_perms(('cableur',)) and\ self.get_source_interface.machine.user != user_request: - return False, u"Vous ne pouvez pas ajouter un alias à une machine\ + return False, u"Vous ne pouvez pas editer un alias à une machine\ d'un autre user que vous sans droit" return True, None diff --git a/machines/templates/machines/:w b/machines/templates/machines/:w new file mode 100644 index 00000000..9d405a79 --- /dev/null +++ b/machines/templates/machines/:w @@ -0,0 +1,139 @@ +{% comment %} +Re2o est un logiciel d'administration développé initiallement au rezometz. Il +se veut agnostique au réseau considéré, de manière à être installable en +quelques clics. + +Copyright © 2017 Gabriel Détraz +Copyright © 2017 Goulven Kermarec +Copyright © 2017 Augustin Lemesle + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +{% endcomment %} + +{% load acl %} + +{% if machines_list.paginator %} +{% include "pagination.html" with list=machines_list %} +{% endif %} + +
{% include "buttons/sort.html" with prefix='machine' col='name' text='Nom DNS' %} | +Type | +MAC | +IP | +Actions | + + {% for machine in machines_list %} +|||
---|---|---|---|---|---|---|---|
+ {{ machine.name|default:'Pas de nom' }} + + {{ machine.user }} + + | ++ {% can_create Machine %} + {% include 'buttons/add.html' with href='machines:new-interface' id=machine.id desc='Ajouter une interface' %} + {% acl_end %} + {% can_edit machine %} + {% include 'buttons/history.html' with href='machines:history' name='machine' id=machine.id %} + {% acl_end %} + {% can_delete machine %} + {% include 'buttons/suppr.html' with href='machines:del-machine' id=machine.id %} + {% acl_end %} + | +||||||
+ {% if interface.domain.related_domain.all %}
+
+
+
+ {% else %}
+ {{ interface.domain }}
+ {% endif %}
+
+ |
+ + {{ interface.type }} + | ++ {{ interface.mac_address }} + | +
+ IPv4 {{ interface.ipv4 }}
+ + {% if ipv6_enabled and interface.ipv6 != 'None'%} + IPv6 {{ interface.ipv6 }} + {% endif %} + |
+
+
+
+ {% include 'buttons/history.html' with href='machines:history' name='interface' id=interface.id %}
+ {% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %}
+
+
+ |
+ |||
+ |
{{ alias }} | + {% can_edit alias %} {% include 'buttons/edit.html' with href='machines:edit-alias' id=alias.id %} + {% acl_end %} {% include 'buttons/history.html' with href='machines:history' name='alias' id=alias.id %} |
{{ extension.origin_v6 }} | {% endif %}+ {% can_create Extension %} {% include 'buttons/edit.html' with href='machines:edit-extension' id=extension.id %} + {% acl_end %} {% include 'buttons/history.html' with href='machines:history' name='extension' id=extension.id %} |
{{ type.vlan }} | {{ type.ouverture_ports }} | + {% can_edit type %} {% include 'buttons/edit.html' with href='machines:edit-iptype' id=type.id %} + {% acl_end %} {% include 'buttons/history.html' with href='machines:history' name='iptype' id=type.id %} | + {% can_create Interface machine.id %} {% include 'buttons/add.html' with href='machines:new-interface' id=machine.id desc='Ajouter une interface' %} + {% acl_end %} {% include 'buttons/history.html' with href='machines:history' name='machine' id=machine.id %} + {% can_delete machine %} {% include 'buttons/suppr.html' with href='machines:del-machine' id=machine.id %} + {% acl_end %} | {% for interface in machine.interface_set.all %} @@ -97,23 +103,31 @@ with this program; if not, write to the Free Software Foundation, Inc., {% include 'buttons/history.html' with href='machines:history' name='interface' id=interface.id %} + {% can_delete interface %} {% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %} -