{% extends "admin/base_site.html" %} {% load admin_urls %} {% block extrahead %}{{ block.super }}{{ form.media }}{% endblock %} {% block breadcrumbs %}{% include "admin/django_action_permissions/actionpermission/_breadcrumbs.html" %}{% endblock %} {% block content %}

Runs the checks a view makes (abac.allowed) for a user, step by step, the project's predicates included. A draft replaces one group's ruleset for this check only: nothing is saved.

{% if form.non_field_errors %}

{{ form.non_field_errors|join:" " }}

{% endif %}
{% for field in form %}
{{ field.errors }}
{{ field.label_tag }} {{ field }}
{% if field.help_text %}
{{ field.help_text }}
{% endif %}
{% endfor %}
{% for code in perm_codes %}
{% if held is not None %}

The action permissions {{ form.cleaned_data.user }} holds

{% if held %} {% for perm, any_object in held %} {% endfor %}
PermissionOn
{{ perm }} {% if any_object %}any object{% else %}the objects a ruleset allows{% endif %} Explain
{% else %}

None.

{% endif %} {% endif %} {% if explanation %} {% with ex=explanation %}

{% if ex.allowed %}Allowed{% else %}Refused{% endif %}: {{ ex.perm_code }} for {{ ex.user }} {% if ex.obj is not None %}on {{ ex.obj }}{% else %}on any object{% endif %}{% if ex.draft %}, with the draft for {{ ex.draft.0 }}{% endif %}.

{{ ex.reason }}

{% if ex.obj is not None %}

A view answers {% if ex.allowed %}200{% elif ex.raises %}500{% elif ex.refusal == 404 %}404: the user can't read it either, its existence isn't revealed{% elif ex.refusal %}{{ ex.refusal }}{% else %}by asking for credentials{% endif %}.

{% endif %} {% if ex.no_detail %}

{{ ex.no_detail|join:", " }}: may list but not retrieve a single object (no_detail).

{% endif %}
{% for note in ex.notes %}

{{ note }}

{% endfor %}

Steps

{% if ex.groups %}

The groups holding it

{% for row in ex.groups %}

{{ row.group }} {% if row.draft %}draft{% endif %} {% if row.skipped %}{% include "admin/django_action_permissions/actionpermission/_answer.html" with evaluated=False %}{% else %}{% include "admin/django_action_permissions/actionpermission/_answer.html" with answer=row.answer blocked=row.blocked evaluated=True %}{% endif %}

{% if row.expression %}

{{ row.expression }}{% if row.checked_user and row.checked_user != ex.user|stringformat:"s" %} run with the rights of {{ row.checked_user }}{% endif %}

{% else %}

No ruleset: on any object.

{% endif %} {% if row.skipped %}

Not run: {{ row.skipped }}.

{% endif %} {% if row.error %}

{{ row.error }}

{% endif %} {% if row.trace %}{% endif %}
{% endfor %} {% endif %} {% if ex.backend %}

The rules backend, {{ ex.backend }}, {% if ex.default_allows %}allows{% else %}denies{% endif %} when no group's ruleset decides.

{% endif %} {% endwith %} {% endif %} {% endblock %}