From 20ef18f98f49e1b1a7d85133351fe0993f7c7534 Mon Sep 17 00:00:00 2001 From: Stefan de Kooter Date: Wed, 1 Sep 2021 10:24:35 +0200 Subject: [PATCH 1/3] Fixes #7113: Add permissions to IPRanges bulk actions within Prefix view --- netbox/ipam/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py index b33947f4e..7bb8bcc7d 100644 --- a/netbox/ipam/views.py +++ b/netbox/ipam/views.py @@ -427,8 +427,16 @@ class PrefixIPRangesView(generic.ObjectView): bulk_querystring = 'vrf_id={}&parent={}'.format(instance.vrf.pk if instance.vrf else '0', instance.prefix) + # Compile permissions list for rendering the object table + permissions = { + 'add': request.user.has_perm('ipam.add_iprange'), + 'change': request.user.has_perm('ipam.change_iprange'), + 'delete': request.user.has_perm('ipam.delete_iprange'), + } + return { 'table': table, + 'permissions': permissions, 'bulk_querystring': bulk_querystring, 'active_tab': 'ip-ranges', } From 909d127c27455fd07cc7e2d07f5a732c5b0563b1 Mon Sep 17 00:00:00 2001 From: Stefan de Kooter Date: Wed, 1 Sep 2021 10:25:37 +0200 Subject: [PATCH 2/3] Fixes #7113: Correct links to IPRanges bulk actions within Prefix view --- netbox/templates/ipam/prefix/ip_ranges.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/templates/ipam/prefix/ip_ranges.html b/netbox/templates/ipam/prefix/ip_ranges.html index 13b41ff5a..e43014042 100644 --- a/netbox/templates/ipam/prefix/ip_ranges.html +++ b/netbox/templates/ipam/prefix/ip_ranges.html @@ -6,7 +6,7 @@
{% include 'inc/table_controls.html' with table_modal="IPRangeTable_config" %} - {% include 'utilities/obj_table.html' with heading='Child IP Ranges' bulk_edit_url='ipam:prefix_bulk_edit' bulk_delete_url='ipam:prefix_bulk_delete' parent=prefix %} + {% include 'utilities/obj_table.html' with heading='Child IP Ranges' bulk_edit_url='ipam:iprange_bulk_edit' bulk_delete_url='ipam:iprange_bulk_delete' parent=prefix %}
{% table_config_form table table_name="IPRangeTable" %} From 6f66b275078244794dffe3e8207bd27c0340f195 Mon Sep 17 00:00:00 2001 From: Stefan de Kooter Date: Wed, 1 Sep 2021 11:00:30 +0200 Subject: [PATCH 3/3] Changelog for #7113 --- docs/release-notes/version-3.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index c03a4687f..9189e4407 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -23,6 +23,7 @@ * [#7101](https://github.com/netbox-community/netbox/issues/7101) - Enforce `MAX_PAGE_SIZE` for table and REST API pagination * [#7106](https://github.com/netbox-community/netbox/issues/7106) - Fix incorrect "Map It" button URL on a site's Physical Address field * [#7107](https://github.com/netbox-community/netbox/issues/7107) - Fix missing search button and search results in IP Address assignment "Assign IP" tab +* [#7113](https://github.com/netbox-community/netbox/issues/7113) - Fix IPRange bulk options within Prefix view ---