-
Hey, I want to create a permission that gives access to all objects that have one specific tenant set. What is the correct way to write a filter for that ? I tried some things, but the UI always comes back with the error Please advise |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
The database field is called However the error suggests you're trying to restrict access to something that doesn't have a "tenant" field anyway. Can you show a more complete extract of your configuration? And what Netbox version are you running? Aside: I agree for your use case that a stable, immutable reference is required. There is indeed some uncertainty around slugs, and in any case they are mutable. Could you just use the netbox tenant id instead (i.e. the database-assigned integer)? It won't change unless the tenant is deleted and recreated. But it won't align between, say, production and test databases. |
Beta Was this translation helpful? Give feedback.
The database field is called
custom_field_data
notcf
(cf is just a python property). See #6478. That implies{"tenant__custom_field_data__snow_account_number": "12345"}
However the error suggests you're trying to restrict access to something that doesn't have a "tenant" field anyway. Can you show a more complete extract of your configuration? And what Netbox version are you running?
Aside: I agree for your use case that a stable, immutable reference is required. There is indeed some uncertainty around slugs, and in any case they are mutable. Could you just use the netbox tenant id instead (i.e. the database-assigned integer)? It won't change unless the tenant is deleted and recreated. Bu…