mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-24 12:54:44 +02:00
Forbid a user to delete himself on the admin page
This commit is contained in:
parent
9fd3012c27
commit
388d26fa05
2 changed files with 8 additions and 2 deletions
|
@ -6,7 +6,7 @@
|
|||
<div class="form-group">
|
||||
<div class=""></div>
|
||||
<div class="col-sm offset-sm-3 ps-2">
|
||||
{% set delete_disabled = (not is_granted("delete", entity)) or (entity.group is defined and entity.id == 1) %}
|
||||
{% set delete_disabled = (not is_granted("delete", entity)) or (entity.group is defined and entity.id == 1) or entity == app.user %}
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-danger" {% if delete_disabled %}disabled{% endif %}>{% trans %}entity.delete{% endtrans %}</button>
|
||||
<button type="button" class="btn btn-danger dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue