Unable to select Custom Field choice for non superuser that has edit permissions #9933

Closed
opened 2025-12-29 21:24:38 +01:00 by adam · 5 comments
Owner

Originally created by @zhazell on GitHub (Jul 2, 2024).

Originally assigned to: @arthanson on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.0.6

Python Version

3.12

Steps to Reproduce

  1. Startup a fresh install of Netbox
  2. Login as superuser
  3. Create a permissions group that has DCIM > Site edit permissions
    Screenshot 2024-07-08 at 1 20 17 PM
  4. Create new user with the newly assigned permissions
    Screenshot 2024-07-08 at 2 34 50 PM
  5. Create a new Custom Field Choice Sets
    Screenshot 2024-07-08 at 2 26 00 PM
  6. Create a new Custom Fields with options:
    Type: Selection
    Choice Set: DNS
    screenshot_8081-2024 07 08-14_28_10
  7. Create a new site as "superadmin" and try new drop down selection "DNS Ready" and see both options available
    screenshot-2024 07 08-14_29_44
  8. Try to login as new test user "testuser" with the "staff" permissions and create a new site and see no options to select under the new Custom Field
    Screenshot 2024-07-08 at 2 42 53 PM
  9. Update permissions to also include Custom Field Choice Set
    Screenshot 2024-07-08 at 2 32 50 PM
  10. Refresh the site page on "testuser" and see the options now, but also they can edit/add/delete Custom Field Choice Set
    Screenshot 2024-07-08 at 2 34 05 PM

Expected Behavior

The drop down shows the choice selections like it does for a super user:
Screenshot 2024-07-02 at 8 24 00 AM

Observed Behavior

Says "No Results Found" instead
Screenshot 2024-07-02 at 8 26 33 AM

Originally created by @zhazell on GitHub (Jul 2, 2024). Originally assigned to: @arthanson on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.0.6 ### Python Version 3.12 ### Steps to Reproduce 1. Startup a fresh install of Netbox 2. Login as superuser 3. Create a permissions group that has **DCIM > Site** edit permissions ![Screenshot 2024-07-08 at 1 20 17 PM](https://github.com/netbox-community/netbox/assets/17417763/dc7d5ff2-b9e5-479f-acf6-8dcd7fcb66f4) 4. Create new user with the newly assigned permissions ![Screenshot 2024-07-08 at 2 34 50 PM](https://github.com/netbox-community/netbox/assets/17417763/adc27f56-f4bb-403c-b370-f4643202f4e7) 5. Create a new Custom Field Choice Sets ![Screenshot 2024-07-08 at 2 26 00 PM](https://github.com/netbox-community/netbox/assets/17417763/9fdc947e-4218-4379-89f8-a83d86e49ea9) 6. Create a new Custom Fields with options: Type: Selection Choice Set: DNS ![screenshot_8081-2024 07 08-14_28_10](https://github.com/netbox-community/netbox/assets/17417763/66667994-989d-4b99-b7c5-1181692b4035) 8. Create a new site as "superadmin" and try new drop down selection "DNS Ready" and see both options available ![screenshot-2024 07 08-14_29_44](https://github.com/netbox-community/netbox/assets/17417763/645bb9bc-ed6c-49c3-920c-421bb4d1d68c) 9. Try to login as new test user "testuser" with the "staff" permissions and create a new site and see no options to select under the new Custom Field ![Screenshot 2024-07-08 at 2 42 53 PM](https://github.com/netbox-community/netbox/assets/17417763/97a8e186-5137-4000-85eb-36c1fe232956) 10. Update permissions to also include **Custom Field Choice Set** ![Screenshot 2024-07-08 at 2 32 50 PM](https://github.com/netbox-community/netbox/assets/17417763/4b6df4b5-f6af-4d92-b8ce-b86c58c1cd5a) 11. Refresh the site page on "testuser" and see the options now, but also they can edit/add/delete Custom Field Choice Set ![Screenshot 2024-07-08 at 2 34 05 PM](https://github.com/netbox-community/netbox/assets/17417763/c32393f0-f406-4317-85e3-49608e4f613f) ### Expected Behavior The drop down shows the choice selections like it does for a super user: ![Screenshot 2024-07-02 at 8 24 00 AM](https://github.com/netbox-community/netbox/assets/17417763/d687e584-74b3-41b1-b21e-49001cc2f808) ### Observed Behavior Says "No Results Found" instead ![Screenshot 2024-07-02 at 8 26 33 AM](https://github.com/netbox-community/netbox/assets/17417763/6d75f623-c740-49ff-92d3-568e978fff97)
adam added the type: bugstatus: revisions neededseverity: low labels 2025-12-29 21:24:38 +01:00
adam closed this issue 2025-12-29 21:24:38 +01:00
Author
Owner

@zhazell commented on GitHub (Jul 2, 2024):

I have to select the "Custom Field Choice Set" permission for this user in order for the choices to show up as selections, but this also gives them the ability to add/delete custom field choices. This behavior seemed to change when we upgraded to v4.
Screenshot 2024-07-02 at 9 15 20 AM
Screenshot 2024-07-02 at 9 15 30 AM

@zhazell commented on GitHub (Jul 2, 2024): I have to select the "Custom Field Choice Set" permission for this user in order for the choices to show up as selections, but this also gives them the ability to add/delete custom field choices. This behavior seemed to change when we upgraded to v4. ![Screenshot 2024-07-02 at 9 15 20 AM](https://github.com/netbox-community/netbox/assets/17417763/f042da9c-f380-4025-bd31-c54bad427dd3) ![Screenshot 2024-07-02 at 9 15 30 AM](https://github.com/netbox-community/netbox/assets/17417763/eebf77bf-c7ae-41a4-b177-b0eee056e343)
Author
Owner

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

@zappy16 please replace the screenshots in your original post above with clear written instructions that someone else can follow to reproduce the reported behavior, beginning with the assignment of user permissions and the creation of the custom field.

@jeremystretch commented on GitHub (Jul 4, 2024): @zappy16 please replace the screenshots in your original post above with clear written instructions that someone else can follow to reproduce the reported behavior, beginning with the assignment of user permissions and the creation of the custom field.
Author
Owner

@zhazell commented on GitHub (Jul 9, 2024):

@zhazell please replace the screenshots in your original post above with clear written instructions that someone else can follow to reproduce the reported behavior, beginning with the assignment of user permissions and the creation of the custom field.

I have updated the screenshots with step by step instructions on how to reproduce the problem.

@zhazell commented on GitHub (Jul 9, 2024): > @zhazell please replace the screenshots in your original post above with clear written instructions that someone else can follow to reproduce the reported behavior, beginning with the assignment of user permissions and the creation of the custom field. I have updated the screenshots with step by step instructions on how to reproduce the problem.
Author
Owner

@arthanson commented on GitHub (Jul 12, 2024):

I think this is more a feature request, @zhazell can you open a feature request for allowing more flexibility in the permission system so that in one permission you could assign different actions to different objects, something like a grid:

                                             View | Add | Change | Delete
dcim > sites                            X.       X.      X.             X
extras > Custom Field.          X

If you create two permissions, the first one for one for DCIM > Sites with all permissions, then a second one for Extras > Custom Field Choices with only View permission and assign both permissions to the user it will work. Then you can close this one.

@arthanson commented on GitHub (Jul 12, 2024): I think this is more a feature request, @zhazell can you open a feature request for allowing more flexibility in the permission system so that in one permission you could assign different actions to different objects, something like a grid: ``` View | Add | Change | Delete dcim > sites X. X. X. X extras > Custom Field. X ``` If you create two permissions, the first one for one for DCIM > Sites with all permissions, then a second one for Extras > Custom Field Choices with only View permission and assign both permissions to the user it will work. Then you can close this one.
Author
Owner

@zhazell commented on GitHub (Jul 17, 2024):

Hmm interesting. I also tried on the latest 3.7.8 release and it does the same. So for now, I've created a separate permission called CF_View and assigned this permission to our staff group. This allows them to "view" only so they can select Custom Field Choices in the Sites screen, but not be able to edit or add any new Custom Field Choices.

Guess this is working as intended, just seems weird that if you add a CF to a specific entity like DCIM->Site, then whoever has site edit permissions should be able to see any CF Choices.

I'll close out then since this seems intended.

@zhazell commented on GitHub (Jul 17, 2024): Hmm interesting. I also tried on the latest 3.7.8 release and it does the same. So for now, I've created a separate permission called CF_View and assigned this permission to our staff group. This allows them to "view" only so they can select Custom Field Choices in the Sites screen, but not be able to edit or add any new Custom Field Choices. Guess this is working as intended, just seems weird that if you add a CF to a specific entity like DCIM->Site, then whoever has site edit permissions should be able to see any CF Choices. I'll close out then since this seems intended.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9933