101 lines
4.8 KiB
HTML
101 lines
4.8 KiB
HTML
{% extends "module_base.html" %}
|
|
{% load static %}
|
|
|
|
{% block title %}Delete Role - {{ role.name }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container-fluid">
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-6">
|
|
<div class="card">
|
|
<div class="card-header bg-danger text-white">
|
|
<h4 class="card-title mb-0">
|
|
<i class="fas fa-exclamation-triangle me-2"></i>Delete Role: {{ role.name }}
|
|
</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="alert alert-danger">
|
|
<h6><i class="fas fa-warning me-2"></i>Warning!</h6>
|
|
<p>You are about to delete the role <strong>{{ role.name }}</strong>. This action cannot be undone.</p>
|
|
|
|
<p>The following data will be permanently deleted:</p>
|
|
<ul class="mb-0">
|
|
<li>Role definition and description</li>
|
|
<li>All permission assignments for this role</li>
|
|
<li>Role assignments from all users</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="card mt-3">
|
|
<div class="card-body">
|
|
<h6>Role Information:</h6>
|
|
<table class="table table-sm">
|
|
<tr>
|
|
<th>Role Name:</th>
|
|
<td>{{ role.name }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Description:</th>
|
|
<td>{{ role.description|default:"-" }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Assigned Users:</th>
|
|
<td>{{ role.userrole_set.count }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Permissions:</th>
|
|
<td>{{ role.rolepermission_set.count }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Created:</th>
|
|
<td>{{ role.created_at|date:"d M Y H:i" }}</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-4">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="card border-warning">
|
|
<div class="card-body">
|
|
<h6 class="text-warning">Impact Analysis:</h6>
|
|
<p class="small mb-0">
|
|
<strong>{{ role.userrole_set.count }} user(s)</strong> will lose this role assignment.<br>
|
|
<strong>{{ role.rolepermission_set.count }} permission(s)</strong> will be removed.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="card border-info">
|
|
<div class="card-body">
|
|
<h6 class="text-info">Recommendation:</h6>
|
|
<p class="small mb-0">
|
|
Consider reassigning affected users to appropriate alternative roles before deletion.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-4 d-flex justify-content-between">
|
|
<a href="{% url 'accounts:role_detail' role.id %}" class="btn btn-secondary">
|
|
<i class="fas fa-arrow-left me-2"></i>Cancel
|
|
</a>
|
|
|
|
<form method="post" class="d-inline">
|
|
{% csrf_token %}
|
|
<button type="submit" class="btn btn-danger"
|
|
onclick="return confirm('Are you sure you want to delete this role? This action cannot be undone.')">
|
|
<i class="fas fa-trash me-2"></i>Yes, Delete Role
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |