mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-01 08:44:48 +02:00
Added a permission to control which users can access private attachments.
This commit is contained in:
parent
9769915b34
commit
e83d72ec10
7 changed files with 31 additions and 9 deletions
|
@ -40,7 +40,9 @@
|
|||
</h6>
|
||||
{% endif %}
|
||||
|
||||
{% if attach.picture %}
|
||||
{% if attach.secure and not is_granted('show_private', attach) %}
|
||||
{# Leave blank #}
|
||||
{% elseif attach.picture %}
|
||||
<a href="{{ attach | entityURL('file_view') }}" rel="noopener" target="_blank" data-no-ajax>
|
||||
<img class="img-fluid img-thumbnail thumbnail-sm" src="{{ attachment_thumbnail(attach, 'thumbnail_md') }}" alt="{% trans %}attachment.preview.alt{% endtrans %}" />
|
||||
</a>
|
||||
|
|
|
@ -41,12 +41,12 @@
|
|||
|
||||
<td><div class="btn-group" role="group" aria-label="">
|
||||
<a {% if attachment_helper.fileExisting(attachment) %}href="{{ attachment|entityURL('file_view') }}"{% endif %} target="_blank"
|
||||
class="btn btn-secondary {% if not attachment_helper.fileExisting(attachment) %}disabled{% endif %}"
|
||||
class="btn btn-secondary {% if not attachment_helper.fileExisting(attachment) or (attachment.secure and not is_granted("show_secure", attachment)) %}disabled{% endif %}"
|
||||
data-no-ajax title="{% trans %}attachment.view{% endtrans %}" rel="noopener">
|
||||
<i class="fas fa-eye fa-fw"></i>
|
||||
</a>
|
||||
<a {% if attachment_helper.fileExisting(attachment) %}href="{{ attachment|entityURL('file_download') }}"{% endif %} data-no-ajax
|
||||
class="btn btn-secondary {% if not attachment_helper.fileExisting(attachment) %}disabled{% endif %}"
|
||||
class="btn btn-secondary {% if not attachment_helper.fileExisting(attachment) or (attachment.secure and not is_granted("show_secure", attachment)) %}disabled{% endif %}"
|
||||
title="{% trans %}attachment.download{% endtrans %}">
|
||||
<i class="fas fa-download fa-fw"></i>
|
||||
</a>
|
||||
|
@ -58,9 +58,6 @@
|
|||
<span class="text-muted dropdown-item-text" ><i class="fas fa-lightbulb fa-fw"></i> <b>ID:</b> {{ attachment.iD }}</span>
|
||||
<span class="text-muted dropdown-item-text" ><i class="fas fa-calendar fa-fw"></i> <b>{% trans %}createdAt{% endtrans %}:</b> {{ attachment.addedDate | format_datetime("short")}}</span>
|
||||
<span class="text-muted dropdown-item-text" ><i class="fas fa-history fa-fw"></i> <b>{% trans %}createdAt{% endtrans %}:</b> {{ attachment.addedDate | format_datetime("short")}}</span>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#">{% trans %}attachment.edit{% endtrans %}</a>
|
||||
<a class="dropdown-item" href="#">{% trans %}attachment.delete{% endtrans %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div></td>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue