django-guardian 1.0.4 documentation
django-guardian template tags. To use in a template just put the following load tag inside a template:
{% load guardian_tags %}
Returns a list of permissions (as codename strings) for a given user/group and obj (Model instance).
Parses get_obj_perms tag which should be in format:
{% get_obj_perms user/group for obj as "context_var" %}
Example of usage (assuming flatpage and perm objects are available from context):
{% get_obj_perms request.user for flatpage as "flatpage_perms" %}
{% if "delete_flatpage" in flatpage_perms %}
<a href="/pages/delete?target={{ flatpage.url }}">Remove page</a>
{% endif %}
Note
Please remember that superusers would always get full list of permissions for a given object.