diff --git a/sapl/base/templatetags/common_tags.py b/sapl/base/templatetags/common_tags.py index 6d4754461..4f8370eac 100644 --- a/sapl/base/templatetags/common_tags.py +++ b/sapl/base/templatetags/common_tags.py @@ -78,5 +78,11 @@ def get_delete_perm(value, arg): return perm.__contains__(nome_app + can_delete) -# view.__class__.model._meta.app_label -> nome do app -# context.getcontext.get('view').__class__.model.__name__.lower() -> nome do model + +@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 260dc5fec..05eba9d86 100644 --- a/sapl/templates/base.html +++ b/sapl/templates/base.html @@ -1,4 +1,5 @@ {% load i18n staticfiles sass_tags menus %} +{% load common_tags %} @@ -89,7 +90,7 @@ - {% if user.is_superuser %} + {% if user|ver_menu_sistema_perm %}