def permission_required(perm, login_url=None):

    return user_passes_test(lambda u: u.has_perm(perm), login_url=login_url)
Replacement for django.contrib.auth.decorators.permission_required that
dataset/ETHPy150Open mingchen/django-cas-ng/django_cas_ng/decorators.py/permission_required