From b29944d5d74cbeca42e057ac631ed87b9ee00b03 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 12 Apr 2019 09:29:36 -0400 Subject: [PATCH] Check view permissions for object navigation tabs --- netbox/templates/circuits/circuit.html | 8 +++++--- netbox/templates/circuits/provider.html | 8 +++++--- netbox/templates/dcim/cable.html | 8 +++++--- netbox/templates/dcim/device.html | 16 ++++++++++------ netbox/templates/dcim/devicetype.html | 8 +++++--- netbox/templates/dcim/interface.html | 8 +++++--- netbox/templates/dcim/rack.html | 8 +++++--- netbox/templates/dcim/site.html | 8 +++++--- netbox/templates/extras/tag.html | 8 +++++--- netbox/templates/ipam/aggregate.html | 8 +++++--- netbox/templates/ipam/ipaddress.html | 8 +++++--- netbox/templates/ipam/prefix.html | 16 ++++++++++------ netbox/templates/ipam/vlan.html | 8 +++++--- netbox/templates/ipam/vrf.html | 8 +++++--- netbox/templates/secrets/secret.html | 8 +++++--- netbox/templates/tenancy/tenant.html | 8 +++++--- netbox/templates/virtualization/cluster.html | 8 +++++--- .../templates/virtualization/virtualmachine.html | 16 ++++++++++------ 18 files changed, 105 insertions(+), 63 deletions(-) diff --git a/netbox/templates/circuits/circuit.html b/netbox/templates/circuits/circuit.html index 890b2a880..8c9620dc1 100644 --- a/netbox/templates/circuits/circuit.html +++ b/netbox/templates/circuits/circuit.html @@ -45,9 +45,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/circuits/provider.html b/netbox/templates/circuits/provider.html index 3dd5d973f..13318492b 100644 --- a/netbox/templates/circuits/provider.html +++ b/netbox/templates/circuits/provider.html @@ -51,9 +51,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/dcim/cable.html b/netbox/templates/dcim/cable.html index 953e6caf4..07a7c49b9 100644 --- a/netbox/templates/dcim/cable.html +++ b/netbox/templates/dcim/cable.html @@ -27,9 +27,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html index b9f283837..dc39959a5 100644 --- a/netbox/templates/dcim/device.html +++ b/netbox/templates/dcim/device.html @@ -86,12 +86,16 @@ {% include 'dcim/inc/device_napalm_tabs.html' %} {% endif %} {% endif %} - - + {% if perms.extras.view_configcontext %} + + {% endif %} + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/dcim/devicetype.html b/netbox/templates/dcim/devicetype.html index 5b5410457..52edf5e09 100644 --- a/netbox/templates/dcim/devicetype.html +++ b/netbox/templates/dcim/devicetype.html @@ -50,9 +50,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/dcim/interface.html b/netbox/templates/dcim/interface.html index 3c3951417..8d12535c0 100644 --- a/netbox/templates/dcim/interface.html +++ b/netbox/templates/dcim/interface.html @@ -32,9 +32,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/dcim/rack.html b/netbox/templates/dcim/rack.html index e702405a2..f3083198c 100644 --- a/netbox/templates/dcim/rack.html +++ b/netbox/templates/dcim/rack.html @@ -47,9 +47,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/dcim/site.html b/netbox/templates/dcim/site.html index 0ef14ee1b..bf95e3050 100644 --- a/netbox/templates/dcim/site.html +++ b/netbox/templates/dcim/site.html @@ -56,9 +56,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/extras/tag.html b/netbox/templates/extras/tag.html index 3c37729e7..3011e2d3b 100644 --- a/netbox/templates/extras/tag.html +++ b/netbox/templates/extras/tag.html @@ -42,9 +42,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/ipam/aggregate.html b/netbox/templates/ipam/aggregate.html index 6fe79810f..d2bedf13d 100644 --- a/netbox/templates/ipam/aggregate.html +++ b/netbox/templates/ipam/aggregate.html @@ -43,9 +43,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/ipam/ipaddress.html b/netbox/templates/ipam/ipaddress.html index c13653e3c..f4e0b495f 100644 --- a/netbox/templates/ipam/ipaddress.html +++ b/netbox/templates/ipam/ipaddress.html @@ -45,9 +45,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/ipam/prefix.html b/netbox/templates/ipam/prefix.html index 281515278..72be2e491 100644 --- a/netbox/templates/ipam/prefix.html +++ b/netbox/templates/ipam/prefix.html @@ -59,12 +59,16 @@ - - + {% if perms.ipam.view_ipaddress %} + + {% endif %} + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/ipam/vlan.html b/netbox/templates/ipam/vlan.html index 7798bf9e0..ae87b5e29 100644 --- a/netbox/templates/ipam/vlan.html +++ b/netbox/templates/ipam/vlan.html @@ -51,9 +51,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/ipam/vrf.html b/netbox/templates/ipam/vrf.html index fb81d7ee1..dbf426321 100644 --- a/netbox/templates/ipam/vrf.html +++ b/netbox/templates/ipam/vrf.html @@ -42,9 +42,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/secrets/secret.html b/netbox/templates/secrets/secret.html index 2825e6770..ce5ab68b4 100644 --- a/netbox/templates/secrets/secret.html +++ b/netbox/templates/secrets/secret.html @@ -33,9 +33,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/tenancy/tenant.html b/netbox/templates/tenancy/tenant.html index 2cb925303..80b40e05b 100644 --- a/netbox/templates/tenancy/tenant.html +++ b/netbox/templates/tenancy/tenant.html @@ -45,9 +45,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/virtualization/cluster.html b/netbox/templates/virtualization/cluster.html index d6a589775..513e122a1 100644 --- a/netbox/templates/virtualization/cluster.html +++ b/netbox/templates/virtualization/cluster.html @@ -45,9 +45,11 @@ - + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %} diff --git a/netbox/templates/virtualization/virtualmachine.html b/netbox/templates/virtualization/virtualmachine.html index b1a8a1505..cac90df42 100644 --- a/netbox/templates/virtualization/virtualmachine.html +++ b/netbox/templates/virtualization/virtualmachine.html @@ -44,12 +44,16 @@ - - + {% if perms.extras.view_configcontext %} + + {% endif %} + {% if perms.extras.view_objectchange %} + + {% endif %} {% endblock %}