refact ergo + page perso (vide)
[auf_rh_dae.git] / project / permissions.py
1 # -*- encoding: utf-8 -*-
2
3 from django.contrib.auth.decorators import user_passes_test
4 from django.contrib.auth.models import Group
5
6 # Logique AUF des permissions
7
8 def is_employe(user):
9 return user.is_authenticated() and user.is_active and user.is_staff
10
11 def is_admin(user):
12 """
13 Un admin est un employé qui est superuser
14 """
15 return is_employe(user) and user.is_superuser