You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set up permissions based on device tenant, should restrict the view on all GC views.
Observed Behavior
All restrictions work, except for Config Compliance list view, where it keeps all GC in scope devices listed.
Steps to Reproduce
Setup GC with demo data and run compliance job
Create a permission for one of the devices / attributes on the device (e.g tenant)
Login with the user that has that permission assigned. Notice that the view is not restricted based on permissions.
The issue comes down to the viewset and the alter_queryset specifically.
Current
defalter_queryset(self, request):
"""Build actual runtime queryset as the build time queryset of table `pivoted`."""returnpivot(
self.queryset,
["device", "device__name"],
"rule__feature__slug",
"compliance_int",
aggregation=Max,
)
Tested solution
defalter_queryset(self, request):
"""Build actual runtime queryset as the build time queryset of table `pivoted`."""self.queryset=super().alter_queryset(request) # <=========returnpivot(
self.queryset,
["device", "device__name"],
"rule__feature__slug",
"compliance_int",
aggregation=Max,
)
The text was updated successfully, but these errors were encountered:
Environment
Expected Behavior
Set up permissions based on device tenant, should restrict the view on all GC views.
Observed Behavior
All restrictions work, except for Config Compliance list view, where it keeps all GC in scope devices listed.
Steps to Reproduce
The issue comes down to the viewset and the alter_queryset specifically.
Current
Tested solution
The text was updated successfully, but these errors were encountered: