Devices > Edit: (get() returned more than one Manufacturer) when using multi custom permissions by tags #5943

Closed
opened 2025-12-29 19:34:32 +01:00 by adam · 5 comments
Owner

Originally created by @atom-tr on GitHub (Jan 14, 2022).

NetBox version

v3.1.5

Python version

3.8

Steps to Reproduce

I want to grant users or groups permissions to view and manage some objects by using tag. When I use a non-Superuser, I will see multiple result with each permission.
Below is an issue when it's happen.

  1. I create 2 permissions for all models have tags with:
  • [{"tags__name": "READABLE"}]: for all user can be view
  • [{"tags__name": "TECH"}]: for only technician can be create and edit.
  1. Technicians will be have both of 2 permissions above
  2. I creat a Manufacturer with 2 tags (READABLE & TECH). One for everyone can see, One for technician can edit and add to devices (I use admin account)
  3. I login to an technician account and create or edit a Device with this Manufacturer
  • I create a device with this Manufacturer => False
    Error

  • I edit a device with this Manufacturer => False
    Error

Expected Behavior

I can add multiple permissions for an object. For a group can edit their own objects and share to everyone with tag READABLE

Observed Behavior

If you use non-admin account, An objects have multiple permissions will return multi results (It's just 1 objeect) for each tag (permission).
In above case, It's raise error because Manufacturer which have Device Type I chosen have 2 tags. And each tags is belong to each custom permission.

Originally created by @atom-tr on GitHub (Jan 14, 2022). ### NetBox version v3.1.5 ### Python version 3.8 ### Steps to Reproduce I want to grant users or groups permissions to view and manage some objects by using tag. When I use a non-Superuser, I will see multiple result with each permission. Below is an issue when it's happen. 1. I create 2 permissions for all models have tags with: - `[{"tags__name": "READABLE"}]`: for all user can be view - `[{"tags__name": "TECH"}]`: for only technician can be create and edit. 2. Technicians will be have both of 2 permissions above 3. I creat a Manufacturer with 2 tags (READABLE & TECH). One for everyone can see, One for technician can edit and add to devices (I use admin account) 4. I login to an technician account and create or edit a Device with this Manufacturer - I create a device with this Manufacturer => False ![Error](https://i.imgur.com/GaNRLAm.png) - I edit a device with this Manufacturer => False ![Error](https://i.imgur.com/7vLWRiL.png) ### Expected Behavior I can add multiple permissions for an object. For a group can edit their own objects and share to everyone with tag READABLE ### Observed Behavior If you use non-admin account, An objects have multiple permissions will return multi results (It's just 1 objeect) for each tag (permission). In above case, It's raise error because Manufacturer which have Device Type I chosen have 2 tags. And each tags is belong to each custom permission.
adam added the type: bugstatus: revisions needed labels 2025-12-29 19:34:32 +01:00
adam closed this issue 2025-12-29 19:34:32 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jan 14, 2022):

Hi, could you please revise your post above to be more clear about what objects you're creating? You mention permissions but don't say to which type(s) of object they're assigned. You also mention manufacturers but are creating/editing devices.

@jeremystretch commented on GitHub (Jan 14, 2022): Hi, could you please revise your post above to be more clear about what objects you're creating? You mention permissions but don't say to which type(s) of object they're assigned. You also mention manufacturers but are creating/editing devices.
Author
Owner

@atom-tr commented on GitHub (Jan 15, 2022):

Hi, could you please revise your post above to be more clear about what objects you're creating? You mention permissions but don't say to which type(s) of object they're assigned. You also mention manufacturers but are creating/editing devices.

I create permissions base on Tags, so i create a permission for all object have tags. When i create a Device with a manufacturer, netbox return 2 manufacturers with each tag and each permission, which is only one if I login by admin account.

@atom-tr commented on GitHub (Jan 15, 2022): > Hi, could you please revise your post above to be more clear about what objects you're creating? You mention permissions but don't say to which type(s) of object they're assigned. You also mention manufacturers but are creating/editing devices. I create permissions base on Tags, so i create a permission for all object have tags. When i create a Device with a manufacturer, netbox return 2 manufacturers with each tag and each permission, which is only one if I login by admin account.
Author
Owner

@atom-tr commented on GitHub (Jan 15, 2022):

Of course I can split permisson for some models that everyone can use. Not use tags. Its will fix the problem.

@atom-tr commented on GitHub (Jan 15, 2022): Of course I can split permisson for some models that everyone can use. Not use tags. Its will fix the problem.
Author
Owner

@jeremystretch commented on GitHub (Jan 17, 2022):

Please go back and rewrite your original post above to clearly indicate the steps someone else can take to reproduce the reported problem.

@jeremystretch commented on GitHub (Jan 17, 2022): Please go back and rewrite your original post above to clearly indicate the steps someone else can take to reproduce the reported problem.
Author
Owner

@jeremystretch commented on GitHub (Feb 1, 2022):

Closing this as sufficient reproduction instructions have not been provided.

@jeremystretch commented on GitHub (Feb 1, 2022): Closing this as sufficient reproduction instructions have not been provided.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5943