Creation of next available IP address via REST API requires extraneous permission #3767

Closed
opened 2025-12-29 18:31:07 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jun 10, 2020).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Python version: 3.6.9
  • NetBox version: 2.8.5

Steps to Reproduce

  1. Create a user with permission to create IP addresses but not prefixes
  2. Assign the user a REST API token with write ability
  3. Create a new prefix and note its numeric ID
  4. Make the following API call in an attempt to create an available IP address within the prefix:
curl -X POST \
-H "Authorization: Token  $TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json; indent=4" \
http://localhost:8000/api/ipam/prefixes/$PREFIX_ID/available-ips/

Expected Behavior

A 201 response should be received indicating the creation of a new IP address.

Observed Behavior

Received a 403 error indicating lack of permission to perform this operation. After assigning the user permission to create a prefix, the request succeeds as expected.

Originally created by @jeremystretch on GitHub (Jun 10, 2020). Originally assigned to: @jeremystretch on GitHub. ### Environment * Python version: 3.6.9 * NetBox version: 2.8.5 ### Steps to Reproduce 1. Create a user with permission to create IP addresses but not prefixes 2. Assign the user a REST API token with write ability 3. Create a new prefix and note its numeric ID 3. Make the following API call in an attempt to create an available IP address within the prefix: ``` curl -X POST \ -H "Authorization: Token $TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json; indent=4" \ http://localhost:8000/api/ipam/prefixes/$PREFIX_ID/available-ips/ ``` ### Expected Behavior A 201 response should be received indicating the creation of a new IP address. ### Observed Behavior Received a 403 error indicating lack of permission to perform this operation. After assigning the user permission to create a prefix, the request succeeds as expected.
adam added the type: bugstatus: accepted labels 2025-12-29 18:31:07 +01:00
adam closed this issue 2025-12-29 18:31:08 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3767