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 890b2a880f9..8c9620dc12e 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 3dd5d973f35..13318492bb3 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 953e6caf427..07a7c49b9b4 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 b9f283837ac..dc39959a542 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 5b5410457d4..52edf5e09e7 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 3c395141789..8d12535c026 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 e702405a27a..f3083198cf7 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 0ef14ee1bd0..bf95e3050e7 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 3c37729e73d..3011e2d3bb6 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 6fe79810f9a..d2bedf13dfd 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 c13653e3cff..f4e0b495fa9 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 281515278ed..72be2e491fa 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 7798bf9e0ed..ae87b5e291c 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 fb81d7ee106..dbf426321be 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 2825e67700a..ce5ab68b4a9 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 2cb925303ae..80b40e05bc5 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 d6a589775c0..513e122a108 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 b1a8a1505a8..cac90df42af 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 %}