From 0f3189c6bd6d14287cfddf3c1d9ceea3e5635ef8 Mon Sep 17 00:00:00 2001 From: lispyclouds Date: Tue, 14 Feb 2017 18:49:41 +0530 Subject: [PATCH] frontpage: Show config options only to admins --- plinth/templates/index.html | 2 +- plinth/views.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plinth/templates/index.html b/plinth/templates/index.html index 54124bfb3..e8ee92605 100644 --- a/plinth/templates/index.html +++ b/plinth/templates/index.html @@ -76,7 +76,7 @@ {% endfor %}
- {% if user.is_authenticated and configure_url %} + {% if user.is_authenticated and user_is_admin and configure_url %} diff --git a/plinth/views.py b/plinth/views.py index 46fe491e3..437a0d211 100644 --- a/plinth/views.py +++ b/plinth/views.py @@ -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):