gestioCOF/kfet/decorators.py
2017-03-10 16:40:36 +01:00

16 lines
486 B
Python

# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from django_cas_ng.decorators import user_passes_test
def kfet_is_team(user):
return user.has_perm('kfet.is_team')
def can_force_close(user):
return user.has_perm('force_close_kfet')
teamkfet_required = user_passes_test(lambda u: kfet_is_team(u))
force_close_required = user_passes_test(lambda u: can_force_close(u))