Imagine you are using django guardian for some object level restrictions.
Now I have the following code; admin.py
class ControlAdmin(GuardedModelAdmin):
prepopulated_fields = {"description": ("title",)}
list_display = ('title', 'description', 'priority')
search_fields = ('title', 'description')
ordering = ('-title',)
Now I have selected in the database that user maxdh has no permissions for viewing a control, which checks out:
>>> control = Control.objects.first()
>>> checker = ObjectPermissionChecker(maxdh)
>>> checker.has_perm('change_control', control)
False
>>> checker.has_perm('view_control', control)
False
However when I go to the html which renders the table for the controls I can still see the table:
html:
<div class="card-body">
<div class="card-body">
{% load django_tables2 %}
{% render_table controls %}
What am I is missing?
I read the docs but could not identify
Please help!
Tried the following:
However leads to