-
Hello fellows, I have done some constraint adjustments in my system. Therefore I link the permission to do something with the site_id and rack_id. device_id's changing too fast. I don't think it's a good idea to use them in the permission system. I want to create a permission system in which everybody can see everything. But different teams should have only the permissions to configure their racks/devices. I would like to combine it with dcim_cable/dcim_interface I do not want that a team set's up a cable from their rack to another that they do not administrate. Therefore a explicit team should be able to do it. dcim_cable and dcim_interface do not have site_id or rack_id in their table. I had no Django or Jsons experience before this project. Now I've read the documentation about the permissions and further the link to django queryset field lookups. I have tried some of the syntax in Netbox. Some things work... like {"site__in": [1,2,3]}. Is it possible to make some join query to get this work? I didn't found the right thing to do so. I found some stackoverflow threads and other websites, that describe some major changes in the code. Maybe I'm blind about the solution and you can help me. Thanks in advance! regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think I found the answer trough "#5405". Sorry for extra posting. I looked up for the syntax on "https://docs.djangoproject.com/en/3.2/ref/models/querysets/#field-lookups" that jeremystretch mentioned in the post. I found the "__" statement but didn't make the transition into the netbox constraints. An admin can delete or close this post. Thank you! |
Beta Was this translation helpful? Give feedback.
I think I found the answer trough "#5405". Sorry for extra posting. I looked up for the syntax on "https://docs.djangoproject.com/en/3.2/ref/models/querysets/#field-lookups" that jeremystretch mentioned in the post. I found the "__" statement but didn't make the transition into the netbox constraints. An admin can delete or close this post. Thank you!