mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Dissuade non-superusers from creating API tokens via the admin view
This commit is contained in:
9
netbox/templates/users/token_edit.html
Normal file
9
netbox/templates/users/token_edit.html
Normal file
@ -0,0 +1,9 @@
|
||||
{% extends 'generic/object_edit.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
{% if not request.user.is_superuser %}
|
||||
{% include 'inc/alerts/warning.html' with title="Creating API Tokens" message="Non-superusers should generally create and modify API tokens under their user profile." %}
|
||||
{% endif %}
|
||||
{{ block.super }}
|
||||
{% endblock %}
|
@ -28,6 +28,7 @@ class TokenView(generic.ObjectView):
|
||||
class TokenEditView(generic.ObjectEditView):
|
||||
queryset = Token.objects.all()
|
||||
form = forms.TokenForm
|
||||
template_name = 'users/token_edit.html'
|
||||
|
||||
|
||||
@register_model_view(Token, 'delete')
|
||||
|
Reference in New Issue
Block a user