Closes #392: Add filtering of ACL Assignments by assigned object type - #419
Merged
Merged
Conversation
Introduces assigned_object_type and assigned_object_type_id filters to ACLAssignmentFilterSet for filtering assignments by their target model. Form limits choices to assignable models and includes comprehensive test coverage for both filter types and unresolvable value handling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Related Issue
Closes #392
New Behavior
Adds
assigned_object_typeandassigned_object_type_idfilters for ACL assignments.The natural-key filter accepts one or more values in
<app_label>.<model>format, while the ID filter accepts content type IDs. The ACL Assignment filter form provides a multi-select limited to the supported assignment target models.Contrast to Current Behavior
Previously, assignments could be filtered by a specific device, interface, virtual chassis, or virtual machine, but not by the type of their assigned object.
This change makes it possible to find broader groups such as all interface assignments, all host assignments, or all assignments targeting virtual machines.
Discussion: Benefits and Drawbacks
This makes inventory and auditing queries available consistently through the UI, REST API, and saved filters.
The change is additive, does not alter existing filter behavior, and requires no database migration. Rendering the filter form requires one additional query to load the available object type choices.
Changes to the Documentation
No standalone documentation changes are required. The new options are exposed through the existing ACL Assignment filter interfaces and follow the established NetBox filter naming conventions.
Proposed Release Note Entry
Add filtering of ACL assignments by assigned object type.
Double Check
feature(next minor release).