Permissions don't work properly with Multiple Select CF #7255

Closed
opened 2025-12-29 20:20:56 +01:00 by adam · 2 comments
Owner

Originally created by @proudbro on GitHub (Nov 18, 2022).

NetBox version

v.3.3.7

Python version

3.8

Steps to Reproduce

Our several permission constraints were worked correctly before the upgrade Netbox v3.3.7 from v3.2.5. For example,
[{"device__tenant__id": 1, "device__custom_field_data__project__in": [["project_name_1"] ,["project_name_2"]]}, {"device__tenant__id": 2}]
This constraint means that the user has access to interfaces (or any other components) of device in tenant with ID=2 or to interfaces (or any other components) of device in tenant with ID=1 AND project_name_1 OR project_name_2 choice (OR both - it's important) in project custom filed which has Multiple selection type.

Steps to Reproduce:

  1. Create project custom filed which has Multiple selection type
  2. Add two choices project_name_1 / project_name_2
  3. Add permission with constraint mentioned above for add/change/delete dcim>interface for test user
  4. Create two devices in different tenants which have been used in constraint

Expected Behavior

When I'm creating new custom field (type: multiple selection) with the same condition I received server error:
image

Observed Behavior

User has access for editing models according to the rule as it had been before 3.3.7

Originally created by @proudbro on GitHub (Nov 18, 2022). ### NetBox version v.3.3.7 ### Python version 3.8 ### Steps to Reproduce Our several permission constraints were worked correctly before the upgrade Netbox v3.3.7 from v3.2.5. For example, `[{"device__tenant__id": 1, "device__custom_field_data__project__in": [["project_name_1"] ,["project_name_2"]]}, {"device__tenant__id": 2}]` This constraint means that the user has access to interfaces (or any other components) of device in tenant with ID=2 or to interfaces (or any other components) of device in tenant with ID=1 **AND** _project_name_1_ OR _project_name_2_ choice (OR both - it's important) in _project_ custom filed which has Multiple selection type. Steps to Reproduce: 1. Create _project_ custom filed which has Multiple selection type 2. Add two choices _project_name_1_ / _project_name_2_ 3. Add permission with constraint mentioned above for add/change/delete dcim>interface for test user 4. Create two devices in different tenants which have been used in constraint ### Expected Behavior When I'm creating new custom field (type: multiple selection) with the same condition I received server error: ![image](https://user-images.githubusercontent.com/60253505/202724453-1ece9bb9-8346-4fc5-850b-4aa654deeda2.png) ### Observed Behavior User has access for editing models according to the rule as it had been before 3.3.7
adam added the type: bugstatus: revisions needed labels 2025-12-29 20:20:56 +01:00
adam closed this issue 2025-12-29 20:20:56 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 21, 2022):

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 (Nov 21, 2022): 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

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

Closing this out as no further clarification of the reproduction steps has been provided.

@jeremystretch commented on GitHub (Dec 1, 2022): Closing this out as no further clarification of the reproduction steps has been provided.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7255