Filter validation for available IPs does not handle custom field constraints for linked objects correctly.
type: bugstatus: acceptedseverity: lownetbox
### NetBox Edition
NetBox Community
### NetBox Version
v4.6.5
### Python Version
3.12
### Steps to Reproduce
1. Create a user
2. Create a tenant with a custom field `integerCustomField` with a value of `1`.
3. Create a prefix `192.168.0.0/24' and assign it to the tenant.
4. Create permission granting `view`, `add`, `change` and `delete` on object type `IPAM | IP Address` with constraints (see below) for the user.
5. Create permission granting `view` on object type `IPAM | Prefix` for the same user, with the same constraint.
6. Logon using the created user.
7. Navigate to Prefix `192.168.0.0/24`.
8. Click on `IP Addresses` tab.
Constraint is this:
```
{
"tenant__custom_field_data__integerCustomField": "1"
}
```
### Expected Behavior
Seeing button(s) showing available IP(s).
### Observed Behavior
The button(s) `X IPs available` are missing. The buttons are visible for users without a tenant custom field constraint. The fix in the related issue worked for the simpler constraint in the related issue, but not for custom fields.
Related to netbox-community/netbox#22539 (PR netbox-community/netbox#22628)
I do not know how custom fields or rather custom fields of linked objects are handled. If someone could point me in the right direction, I would gladly fix it myself and create another PR.
4 条评论