You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.4 KiB
HTML

{% extends 'base.html' %}
{% block content %}
<header>
<h1>{{ rule.name }}</h1>
<p>File Owner: {{ rule.file.owner.username }}</p>
<a href="{% url 'abac:file_detail' file_id=rule.file.id %}">Back to {{ rule.file.name }}</a>
</header>
<div class="container">
<h2>{{ rule.name }} Details</h2>
<table class="table">
<thead>
<tr>
<th>Attribute Name</th>
<th>Operator</th>
<th>Value</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for rule_attribute in rule_attributes %}
<tr>
<td>{{ rule_attribute.attribute_type.name }}</td>
<td>{{ rule_attribute.operator }}</td>
<td>{{ rule_attribute.value }}</td>
<td>
<a href="{% url 'abac:delete_rule_attribute' file_id=file.id rule_id=rule.id rule_attribute_id=rule_attribute.id %}" class="btn btn-danger">Delete</a>
</td>
</tr>
{% endfor %}
<tr>
<!-- Form to add new RuleAttribute -->
<form method="post" action="{% url 'abac:rule_detail' file_id=file.id rule_id=rule.id %}">
{% csrf_token %}
<td>{{ form.attribute_type }}</td>
<td>{{ form.operator }}</td>
<td>{{ form.value }}</td>
<td><input type="submit" class="btn btn-success" value="Add"></td>
</form>
</tr>
</tbody>
</table>
</div>
{% endblock %}