mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-01 00:35:15 +02:00
Added permissions to control access to API and manage API tokens
This commit is contained in:
parent
be14fe548c
commit
8fe3f4cf5c
7 changed files with 60 additions and 26 deletions
|
@ -55,7 +55,9 @@
|
|||
</table>
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ path('user_api_token_create') }}" class="btn btn-success" ><i class="fas fa-plus-square fa-fw"></i> {% trans %}api_token.create_new{% endtrans %}</a>
|
||||
<a href="{{ path('user_api_token_create') }}" class="btn btn-success" {% if not is_granted('@api.manage_tokens') %}disabled="disabled"{% endif %}>
|
||||
<i class="fas fa-plus-square fa-fw"></i> {% trans %}api_token.create_new{% endtrans %}
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
|
@ -77,5 +77,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{% include "users/_api_tokens.html.twig" %}
|
||||
{% if is_granted("@api.access_api") %}
|
||||
{% include "users/_api_tokens.html.twig" %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue