Cannot assign IP address from Interface without add ip_address rights. #9265

Closed
opened 2025-12-29 20:47:40 +01:00 by adam · 1 comment
Owner

Originally created by @rkiss on GitHub (Feb 18, 2024).

Deployment Type

Self-hosted

NetBox Version

v3.7.2

Python Version

3.8

Steps to Reproduce

Create Device with one interface
Create ip address
Switch to a user that does not have add ip_address right (but have view and change ip_address rights)
Try to assign the ip to the interface from one of the following pages:

  • device view, interfaces tab (dcim/devices//interfaces/
  • Interfaces view (dcim/interfaces//)

Expected Behavior

An action should be present that allow the user to navigate to the assign ip address page.

Observed Behavior

The "Create IP address" (from devices/interfaces tab) or "Add IP address" (from interface view) is not present so the page cannot be triggered.
Of course, the "add ip address" that those action could trigger would fail (ipam/ip-addresses/add/?interface=&return_url=/dcim/devices//interfaces/) with no permission error.
But the assign page from (ipam/ip-addresses/assign/?interface=&return_url=/dcim/devices//interfaces/) would work however the user cannot trigger that page because there is no dedicated button for it.
The only way the user can assign an ip is by editing the ip address record.

I think that there should a single "add-or-assign IP address" page that have 2 tabs for creating an address or assigning one which will be visible only if the user have the corresponding rights: add or edit. Then, the action will be visible on the interface if the use have at least one of the rights.

Originally created by @rkiss on GitHub (Feb 18, 2024). ### Deployment Type Self-hosted ### NetBox Version v3.7.2 ### Python Version 3.8 ### Steps to Reproduce Create Device with one interface Create ip address Switch to a user that does not have add ip_address right (but have view and change ip_address rights) Try to assign the ip to the interface from one of the following pages: - device view, interfaces tab (dcim/devices/<ID>/interfaces/ - Interfaces view (dcim/interfaces/<ID>/) ### Expected Behavior An action should be present that allow the user to navigate to the assign ip address page. ### Observed Behavior The "Create IP address" (from devices/interfaces tab) or "Add IP address" (from interface view) is not present so the page cannot be triggered. Of course, the "add ip address" that those action could trigger would fail (ipam/ip-addresses/add/?interface=<ID>&return_url=/dcim/devices/<ID>/interfaces/) with no permission error. But the assign page from (ipam/ip-addresses/assign/?interface=<ID>&return_url=/dcim/devices/<ID>/interfaces/) would work however the user cannot trigger that page because there is no dedicated button for it. The only way the user can assign an ip is by editing the ip address record. I think that there should a single "add-or-assign IP address" page that have 2 tabs for creating an address or assigning one which will be visible only if the user have the corresponding rights: add or edit. Then, the action will be visible on the interface if the use have at least one of the rights.
adam closed this issue 2025-12-29 20:47:40 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 20, 2024):

The only way the user can assign an ip is by editing the ip address record.

Yes, this is the intended workflow. These links are not shown because they go to the creation form form for IP addresses, which the user does not have permission to access. Instead, the user can navigate to the relevant IP address and assign it to the desired interface. Alternatively, you can grant the user permission to create IP addresses.

@jeremystretch commented on GitHub (Feb 20, 2024): > The only way the user can assign an ip is by editing the ip address record. Yes, this is the intended workflow. These links are not shown because they go to the creation form form for IP addresses, which the user does not have permission to access. Instead, the user can navigate to the relevant IP address and assign it to the desired interface. Alternatively, you can grant the user permission to create IP addresses.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9265