#30705: Django template permissions not working when used inside the template of an inclusion tag -------------------------------------+------------------------------------- Reporter: erev0s | Owner: nobody Type: Uncategorized | Status: closed Component: Template system | Version: 2.2 Severity: Normal | Resolution: needsinfo Keywords: permissions, | Triage Stage: inclusion tag | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by erev0s): I have added as an attachment a modified version of the famous django example shown here https://github.com/mdn/django-locallibrary-tutorial In the attachment you will find an additional app named "check_permissions". Inside the "templatetags" you will find the "custom_tag.py" where there is an inclusion tag using the "permision_required" decorator. The template used for the inclusion tag is located in "catalog/templates /link-tag.html" and the custom tag is loaded in the "catalog/templates/index.html" which is the main page you find after you run the project. After you have created an admin user and you setup and run the project you will see in the "http://localhost:8000/catalog/" at the bottom that you are able to see only the second "<li>" found there. [[Image(https://i.imgur.com/6Z6Nq6L.png)]] The permission inside the "link-tag.html" is NOT found probably or something similar, due to even admin can not access the content. -- Ticket URL: <https://code.djangoproject.com/ticket/30705#comment:2> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.836298dea80fb62ab8f2257e98a9d15f%40djangoproject.com.