Choice Sets require explicit View permission for API to avoid HTTP 403 error #10011

Closed
opened 2025-12-29 21:25:36 +01:00 by adam · 2 comments
Owner

Originally created by @ed-ud on GitHub (Jul 25, 2024).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.0.7

Python Version

3.12

Steps to Reproduce

  1. Create a Choice Set.
  2. Query API query of choice set using a token (for a user) which has View All permission.
  3. Query returns HTTP 403 error.
  4. Add specific View permission for Choice Sets to the token's user.
  5. Query succeeds.

Expected Behavior

View All permission should allow API query of Choice Sets.

Observed Behavior

HTTP 403 error.

Originally created by @ed-ud on GitHub (Jul 25, 2024). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.0.7 ### Python Version 3.12 ### Steps to Reproduce 1. Create a Choice Set. 2. Query API query of choice set using a token (for a user) which has View All permission. 3. Query returns HTTP 403 error. 4. Add specific View permission for Choice Sets to the token's user. 5. Query succeeds. ### Expected Behavior View All permission should allow API query of Choice Sets. ### Observed Behavior HTTP 403 error.
adam added the type: bugstatus: revisions needed labels 2025-12-29 21:25:36 +01:00
adam closed this issue 2025-12-29 21:25:37 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 26, 2024):

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

@jeremystretch commented on GitHub (Jul 26, 2024): Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.
Author
Owner

@ed-ud commented on GitHub (Jul 26, 2024):

The issue turns out to be with our existing "View All" permission object (I forgot that this is not a "canned" permission - we had created it back in 3.x with the object types at the time). It no longer included ALL object types because the Custom Field Choice Set model was added AFTER the permission was created. It might be handy to have a canned "View All" permission or an "All Object Types" setting.

@ed-ud commented on GitHub (Jul 26, 2024): The issue turns out to be with our existing "View All" permission object (I forgot that this is not a "canned" permission - we had created it back in 3.x with the object types at the time). It no longer included ALL object types because the Custom Field Choice Set model was added AFTER the permission was created. It might be handy to have a canned "View All" permission or an "All Object Types" setting.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10011