Repository: netbox-community/netbox

Issue:
IPRanges bulk options within Prefix view are missing
### NetBox version

v3.0.0

### Python version

3.8

### Steps to Reproduce

1. Open the IP Ranges tab within a prefix [example](https://demo.netbox.dev/ipam/prefixes/43/ip-ranges/)

### Expected Behavior

The 'edit selected' and 'delete selected' buttons should appear

### Observed Behavior

No bulk options available.

This is due to the same reason as #7092. I replicated the changes @thatmattlove made on that. Additionally, the actions tied to the buttons is incorrectly set to the wrong bulk edit page.

I have a patch ready for this if needed.


Discussion:
Fix missing permissions on the view:
```
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',
         }
```

Fix the links to the wrong bulk action urls:
```
diff --git a/netbox/templates/ipam/prefix/ip_ranges.html b/netbox/templates/ipam/prefix/ip_ranges.html
index 18b53d945..3d15624bf 100644
--- a/netbox/templates/ipam/prefix/ip_ranges.html
+++ b/netbox/templates/ipam/prefix/ip_ranges.html
@@ -6,7 +6,7 @@
   <div class="row">
     <div class="col col-md-12">
       {% 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 %}
     </div>
   </div>
   {% table_config_form table table_name="IPRangeTable" %}
```

Resolving patch:
diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py
--- a/netbox/ipam/views.py
+++ b/netbox/ipam/views.py
@@ -427,8 +427,16 @@ def get_extra_context(self, request, instance):
 
         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',
         }


Test patch: