diff --git a/re2o/context_processors.py b/re2o/context_processors.py new file mode 100644 index 00000000..d4de21b8 --- /dev/null +++ b/re2o/context_processors.py @@ -0,0 +1,17 @@ + + +def context_user(request): + user = request.user + is_cableur = user.has_perms(('cableur',)) + is_bureau = user.has_perms(('bureau',)) + is_bofh = user.has_perms(('bofh',)) + is_trez = user.has_perms(('trésorier',)) + is_infra = user.has_perms(('infra',)) + return { + 'request_user': user, + 'is_cableur': is_cableur, + 'is_bureau': is_bureau, + 'is_bofh': is_bofh, + 'is_trez': is_trez, + 'is_infra': is_infra, + } diff --git a/templates/base.html b/templates/base.html index e482c550..5189bc3a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -85,12 +85,12 @@
Vous n'êtes pas authentifié