Hide Related Objects Based On Its Permissions #9589

Closed
opened 2025-12-29 21:19:22 +01:00 by adam · 10 comments
Owner

Originally created by @mr1716 on GitHub (May 6, 2024).

NetBox version

v3.7.7

Feature type

New functionality

Proposed functionality

Hey, just like changing the permissions can hide the Contacts page for specific sites (such as .../dcim/sites/X with X being a valid site number), this would do the same for dcim sites and dcim regions Related Objects. The goal would be to be able to hide Related Objects that arent being used based upon specific permissions. Right now, the users can click on them, but will get an error if not provided permissions. This would hide that so the users wouldnt see the options they lack permissions to.

Use case

Provide cleaner viewing and user experience for users. Plus, it would implement functionality that exist with other functionality in Netbox.

Database changes

Not sure

External dependencies

N/A I think

Originally created by @mr1716 on GitHub (May 6, 2024). ### NetBox version v3.7.7 ### Feature type New functionality ### Proposed functionality Hey, just like changing the permissions can hide the Contacts page for specific sites (such as .../dcim/sites/X with X being a valid site number), this would do the same for dcim sites and dcim regions Related Objects. The goal would be to be able to hide Related Objects that arent being used based upon specific permissions. Right now, the users can click on them, but will get an error if not provided permissions. This would hide that so the users wouldnt see the options they lack permissions to. ### Use case Provide cleaner viewing and user experience for users. Plus, it would implement functionality that exist with other functionality in Netbox. ### Database changes Not sure ### External dependencies N/A I think
adam added the type: featurestatus: duplicate labels 2025-12-29 21:19:22 +01:00
adam closed this issue 2025-12-29 21:19:22 +01:00
Author
Owner

@mr1716 commented on GitHub (May 7, 2024):

This may also be an improvement or change to functionality as well. Not sure it’s classified correctly, so please correct.

@mr1716 commented on GitHub (May 7, 2024): This may also be an improvement or change to functionality as well. Not sure it’s classified correctly, so please correct.
Author
Owner

@jeffgdotorg commented on GitHub (May 7, 2024):

Thanks for your interest in helping improve NetBox. I've triaged this feature request as actionable and moved it to the needs owner status. If you would like to volunteer to work it through to a PR, please let us know and a maintainer will assign it to you. Otherwise, another developer with the requisite skills may pick it up as capacity permits.

@jeffgdotorg commented on GitHub (May 7, 2024): Thanks for your interest in helping improve NetBox. I've triaged this feature request as actionable and moved it to the `needs owner` status. If you would like to volunteer to work it through to a PR, please let us know and a maintainer will assign it to you. Otherwise, another developer with the requisite skills may pick it up as capacity permits.
Author
Owner

@jeffgdotorg commented on GitHub (May 7, 2024):

This may also be an improvement or change to functionality as well. Not sure it’s classified correctly, so please correct.

Feature request (FR) is appropriate since we don't currently have a separate enhancement type designation. Thanks for your openness to correction.

@jeffgdotorg commented on GitHub (May 7, 2024): > This may also be an improvement or change to functionality as well. Not sure it’s classified correctly, so please correct. Feature request (FR) is appropriate since we don't currently have a separate _enhancement_ type designation. Thanks for your openness to correction.
Author
Owner

@mr1716 commented on GitHub (May 7, 2024):

@jeffgdotorg, thanks for the assistance and information. It would be best if someone else took the lead as I am not entirely sure on this, and it seems that someone who knows Netbox better would be able to do this faster. I am not sure that this would be a big fix and hope that is the case.

@mr1716 commented on GitHub (May 7, 2024): @jeffgdotorg, thanks for the assistance and information. It would be best if someone else took the lead as I am not entirely sure on this, and it seems that someone who knows Netbox better would be able to do this faster. I am not sure that this would be a big fix and hope that is the case.
Author
Owner

@mr1716 commented on GitHub (May 8, 2024):

To be clear, one can set the proper permissions so when the user clicks the specific Related Object, it would show an access denied message if unable to access. This request is to go a step further, as to hide these values in the UI as well

@mr1716 commented on GitHub (May 8, 2024): To be clear, one can set the proper permissions so when the user clicks the specific Related Object, it would show an access denied message if unable to access. This request is to go a step further, as to hide these values in the UI as well
Author
Owner

@abhi1693 commented on GitHub (May 9, 2024):

Before I take this task up, how would the permission chekc work with only a subset of related objects are allowed? Hiding the objects based on a simple check will break this use case.

@abhi1693 commented on GitHub (May 9, 2024): Before I take this task up, how would the permission chekc work with only a subset of related objects are allowed? Hiding the objects based on a simple check will break this use case.
Author
Owner

@mr1716 commented on GitHub (May 9, 2024):

@abhi1693 if you go to individual Sites and Regions, you’ll see a card with Related Objects on the right side. I can disable the permissions to provide an “Access Denied” to users. Rather than provide that error, why not have those options that the user lacks permissions to view, be removed. That’s the request. And it wouldn’t break the use case as the use case is to hide functionality that isn’t being used based on provided functionality. There are other ways to hide functionality and pages and such based upon permissions, so this should follow suit.

@mr1716 commented on GitHub (May 9, 2024): @abhi1693 if you go to individual Sites and Regions, you’ll see a card with Related Objects on the right side. I can disable the permissions to provide an “Access Denied” to users. Rather than provide that error, why not have those options that the user lacks permissions to view, be removed. That’s the request. And it wouldn’t break the use case as the use case is to hide functionality that isn’t being used based on provided functionality. There are other ways to hide functionality and pages and such based upon permissions, so this should follow suit.
Author
Owner

@mr1716 commented on GitHub (May 9, 2024):

@abhi1693 here's a visual look at what the current Related Image looks like. But since I am not using and have disabled permissions for users to view items such as Locations, Circuits, and VLANs, they shouldnt show up. Even though when clicked, the user gets a "You do not have permission to access this page." message. This request is to NOT even show them if the user lacks the permissions to view.
image

@mr1716 commented on GitHub (May 9, 2024): @abhi1693 here's a visual look at what the current Related Image looks like. But since I am not using and have disabled permissions for users to view items such as Locations, Circuits, and VLANs, they shouldnt show up. Even though when clicked, the user gets a "You do not have permission to access this page." message. This request is to NOT even show them if the user lacks the permissions to view. ![image](https://github.com/netbox-community/netbox/assets/9115680/67a29271-a0c7-4503-916a-7a30ca9052f7)
Author
Owner

@jeremystretch commented on GitHub (May 9, 2024):

There's some overlap here with #15794 FYI.

@jeremystretch commented on GitHub (May 9, 2024): There's some overlap here with #15794 FYI.
Author
Owner

@jeremystretch commented on GitHub (May 21, 2024):

I believe this is a duplicate of #15294. Please continue any further discussion under that thread.

@jeremystretch commented on GitHub (May 21, 2024): I believe this is a duplicate of #15294. Please continue any further discussion under that thread.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9589