mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 09:16:10 -06:00
12625: change datasource password display and hide for read-only users
This commit is contained in:
parent
c9b79ca579
commit
b92a4dc450
@ -2,6 +2,7 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
{% load helpers %}
|
{% load helpers %}
|
||||||
{% load plugins %}
|
{% load plugins %}
|
||||||
|
{% load perms %}
|
||||||
{% load render_table from django_tables2 %}
|
{% load render_table from django_tables2 %}
|
||||||
|
|
||||||
{% block extra_controls %}
|
{% block extra_controls %}
|
||||||
@ -88,7 +89,16 @@
|
|||||||
{% for name, field in object.get_backend.parameters.items %}
|
{% for name, field in object.get_backend.parameters.items %}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{{ field.label }}</th>
|
<th scope="row">{{ field.label }}</th>
|
||||||
<td>{{ object.parameters|get_key:name|placeholder }}</td>
|
{% if field.label == "Password" %}
|
||||||
|
<td>
|
||||||
|
{% if request.user|can_add:object or request.user|can_change:object or request.user|can_delete:object %}
|
||||||
|
<span id="secret" class="font-monospace" data-secret="{{ object.parameters|get_key:name }}">{{ object.parameters|get_key:name|placeholder }}</span>
|
||||||
|
<button type="button" class="btn btn-sm btn-primary toggle-secret float-end" data-bs-toggle="button">Show Secret</button>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
{% else %}
|
||||||
|
<td>{{ object.parameters|get_key:name|placeholder }}</td>
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<tr>
|
<tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user