netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Public demo: https://demo.netbox.dev
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.61k stars 2.53k forks source link

Ability to filter objects (devices/vm, etc) by Contact with specific Contact role #15242

Open DevFinGitGovSecChatOps opened 6 months ago

DevFinGitGovSecChatOps commented 6 months ago

NetBox version

v3.7.3

Feature type

New functionality

Proposed functionality

This is an extension of https://github.com/netbox-community/netbox/issues/9239 and https://github.com/netbox-community/netbox/pull/8742

At the moment it is not possible to filter a specific object-type (for example vm) by a contact that has a specific role. (GUI: Virtualization/Virtual Machines/Filters)

For example:

VM Contact Contact Role
vm1 Mario Admin
vm1 Luigi User
vm2 Luigi Admin
vm2 Mario User

Task: "Filter VMs where Mario has the Contact Role Admin"

Behavior: At the moment it shows all vms where Mario is a Contact OR any Contact has the Role Admin

Expected behavior: Show all vms where Mario has the Role Admin (Contact Assignment)

I know there is a filter in tenancy/contact-assignments/ already. It would be really usefull to be able to use it in the above mentioned filters as well.

Use case

It would allow to filter Objects for a user with a specific role combined with additional filters (In case of VM for example by status, location or anything else)

"Show me all VMs with Status Maintenance where I (UserXYZ) have the Contact Role Admin"

Database changes

I don't know

External dependencies

None I guess?

DevFinGitGovSecChatOps commented 5 months ago

Graphical representation: grafik

Julio-Oliveira-Encora commented 4 months ago

I tested and was not able to reproduce the issue.

Screenshot from 2024-04-23 15-03-52 Screenshot from 2024-04-23 15-02-18 Screenshot from 2024-04-23 15-07-48

DevFinGitGovSecChatOps commented 3 months ago

Your screenshots don't really show an exact reproduction of my UseCase. In your screenshot the Users have the same roles on both VMs, in my example the Users have switched roles on the VMs.

Julio-Oliveira-Encora commented 3 months ago

I fixed it, and I was able to reproduce the error.

Screenshot from 2024-05-06 16-25-59

vm2

Screenshot from 2024-05-06 16-25-40

We need to verify if the search will do it using the "contact AND his role" or "contact" and "role" as separate fields (current).

github-actions[bot] commented 1 day ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.