November 2015
Beginner to intermediate
840 pages
26h 30m
English
While our webpages are now fully protected, many of our templates still link to these protected views. We will be displaying links to views that unauthenticated users cannot reach, which is misleading.
Thankfully, as shown in Example 20.61, we can check permissions in the template thanks to the perms variable, added in by context processor (therefore requiring RequestContext).
Example 20.61: Python Code
{% if perms.organizer.add_tag %} {% if perms.organizer.change_tag %} {% if perms.organizer.delete_tag %}
Much as we did with the CSS conditional checks we created in Chapter 16: Serving Static Content with Django, we can use basic logic to change how our webpages are ...
Read now
Unlock full access