auth ist im kasten
This commit is contained in:
1 parent
8498781c85
commit
7f81932fa5
14 files changed
+843
-443
No files matched your search
@@ -0,0 +1,123 @@
|
||||
# ==============================================================================
|
||||
# Formeleon - Multi-tenant Form Generator
|
||||
# Author: Björn Runden <br@runden.net>
|
||||
# Template: admin/users/tenants.html
|
||||
# Description: Manage tenant assignments for a user.
|
||||
# ============================================================================== #}
|
||||
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Manage Tenants for {{ target_user.name }} - Formeleon{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row mb-4">
|
||||
<div class="col-12 d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<h1><i class="bi bi-buildings"></i> Manage Tenants for {{ target_user.name }}</h1>
|
||||
<p class="text-muted mb-0">
|
||||
Assign or remove tenants from this user's access list.
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{{ url_for('admin.view_user', user_id=target_user.id) }}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left"></i> Back to User
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header bg-light">
|
||||
<h5><i class="bi bi-list-check"></i> Tenant Assignments</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{# Available Tenants #}
|
||||
<div class="col-md-6">
|
||||
<h6><i class="bi bi-plus-circle"></i> Available Tenants</h6>
|
||||
<p class="text-muted small">Tenants not yet assigned to this user</p>
|
||||
|
||||
{% if all_tenants %}
|
||||
<div class="list-group" style="max-height: 400px; overflow-y: auto;">
|
||||
{% for tenant in all_tenants %}
|
||||
{% if tenant not in user_tenants %}
|
||||
<form method="POST" action="{{ url_for('admin.manage_user_tenants', user_id=target_user.id) }}" class="list-group-item">
|
||||
<input type="hidden" name="action" value="add">
|
||||
<input type="hidden" name="tenant_id" value="{{ tenant.id }}">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<strong>{{ tenant.name }}</strong>
|
||||
<span class="badge bg-{{ 'success' if tenant.status.value == 'active' else 'warning' if tenant.status.value == 'suspended' else 'danger' }} ms-2">
|
||||
{{ tenant.status.value }}
|
||||
</span>
|
||||
<div class="text-muted small">{{ tenant.id }}</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-sm btn-outline-success" title="Add tenant">
|
||||
<i class="bi bi-plus-circle"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-muted">No tenants available to assign.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Assigned Tenants #}
|
||||
<div class="col-md-6">
|
||||
<h6><i class="bi bi-check-circle"></i> Assigned Tenants</h6>
|
||||
<p class="text-muted small">Tenants currently assigned to this user</p>
|
||||
|
||||
{% if user_tenants %}
|
||||
<div class="list-group" style="max-height: 400px; overflow-y: auto;">
|
||||
{% for tenant in user_tenants %}
|
||||
<form method="POST" action="{{ url_for('admin.manage_user_tenants', user_id=target_user.id) }}" class="list-group-item">
|
||||
<input type="hidden" name="action" value="remove">
|
||||
<input type="hidden" name="tenant_id" value="{{ tenant.id }}">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<strong>{{ tenant.name }}</strong>
|
||||
<span class="badge bg-{{ 'success' if tenant.status.value == 'active' else 'warning' if tenant.status.value == 'suspended' else 'danger' }} ms-2">
|
||||
{{ tenant.status.value }}
|
||||
</span>
|
||||
<div class="text-muted small">{{ tenant.id }}</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger" title="Remove tenant">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-muted">No tenants assigned to this user.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h6><i class="bi bi-info-circle"></i> Information</h6>
|
||||
<ul>
|
||||
<li><strong>Admin users</strong> have access to all tenants and can manage any user.</li>
|
||||
<li><strong>Tenant Admin users</strong> have access only to tenants they are assigned to.</li>
|
||||
<li><strong>Regular users</strong> can only access tenants they are explicitly assigned to.</li>
|
||||
<li>Changes to tenant assignments take effect immediately.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user