Works almost

This commit is contained in:
2023-09-28 17:29:30 +02:00
parent 175e13da4f
commit 92546024d8
147 changed files with 31229 additions and 70 deletions

View File

@@ -0,0 +1,48 @@
{% 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 %}