diff --git a/sapl/base/templatetags/common_tags.py b/sapl/base/templatetags/common_tags.py index 0638203cd..f0b0b16a1 100644 --- a/sapl/base/templatetags/common_tags.py +++ b/sapl/base/templatetags/common_tags.py @@ -86,3 +86,12 @@ def get_delete_perm(value, arg): can_delete = '.delete_' + nome_model return perm.__contains__(nome_app + can_delete) + + +@register.filter +def ver_menu_sistema_perm(value): + u = value + if u.groups.filter(name='Operador Geral').exists() or u.is_superuser: + return True + else: + return False diff --git a/sapl/templates/base.html b/sapl/templates/base.html index 8c269f1fe..183ddab50 100644 --- a/sapl/templates/base.html +++ b/sapl/templates/base.html @@ -1,4 +1,5 @@ {% load i18n staticfiles sass_tags menus %} +{% load common_tags %} @@ -97,7 +98,7 @@ - {% if user.is_superuser %} + {% if user|ver_menu_sistema_perm %}