frontpage: Show config options only to admins

This commit is contained in:
lispyclouds 2017-02-14 18:49:41 +05:30 committed by Sunil Mohan Adapa
parent b0321d7d29
commit 0f3189c6bd
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 3 additions and 2 deletions

View File

@ -76,7 +76,7 @@
{% endfor %}
<br>
{% if user.is_authenticated and configure_url %}
{% if user.is_authenticated and user_is_admin and configure_url %}
<a class="btn btn-primary btn-sm"
style="margin-left : 10px; margin-bottom : 5px"
href="{{ configure_url }}">

View File

@ -50,7 +50,8 @@ def index(request):
'selected_id': selection,
'details': details,
'details_label': details_label,
'configure_url': configure_url })
'configure_url': configure_url,
'user_is_admin': request.user.groups.filter(name='admin').exists()})
class ServiceView(FormView):