Files
PyRIGS/training/decorators.py
FreneticScribbler 6414e68231 Migrate to is_supervisor being a database field
More efficient, but it does reduce app seperation. Probably not an issue for us!
2022-01-09 15:06:11 +00:00

6 lines
256 B
Python

from PyRIGS.decorators import user_passes_test_with_403
def has_perm_or_supervisor(perm, login_url=None, oembed_view=None):
return user_passes_test_with_403(lambda u: u.is_supervisor or u.has_perm(perm), login_url=login_url, oembed_view=oembed_view)