Draft: Authens ! #767

Open
mpepin wants to merge 5 commits from kerl/authens into master
Showing only changes of commit 7b8d1575c0 - Show all commits

View file

@ -1,8 +1,15 @@
from django.contrib.auth.decorators import user_passes_test
from django.core.exceptions import PermissionDenied
def kfet_is_team(user):
return user.has_perm("kfet.is_team")
if user.is_authenticated:
if user.has_perm("kfet.is_team"):
return True
else:
raise PermissionDenied
else:
return False
teamkfet_required = user_passes_test(kfet_is_team)