From 3248c2573d29ac5e0914497fd18fcf2d4719bd1d Mon Sep 17 00:00:00 2001 From: Rahul De Date: Thu, 23 Mar 2017 16:14:52 +0530 Subject: [PATCH] Hide apps and sys icons if user is not an admin --- plinth/context_processors.py | 4 +++- plinth/templates/base.html | 2 +- plinth/tests/test_context_processors.py | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/plinth/context_processors.py b/plinth/context_processors.py index d7de023ee..fe49f6310 100644 --- a/plinth/context_processors.py +++ b/plinth/context_processors.py @@ -23,6 +23,7 @@ from django.utils.translation import ugettext as _, ugettext_noop import re from plinth import cfg +from plinth.utils import is_user_admin def common(request): @@ -41,5 +42,6 @@ def common(request): 'cfg': cfg, 'submenu': cfg.main_menu.active_item(request), 'active_menu_urls': active_menu_urls, - 'box_name': _(cfg.box_name) + 'box_name': _(cfg.box_name), + 'user_is_admin': is_user_admin(request.user) } diff --git a/plinth/templates/base.html b/plinth/templates/base.html index 9f061a3ba..c5570c240 100644 --- a/plinth/templates/base.html +++ b/plinth/templates/base.html @@ -96,7 +96,7 @@