Change: Only supervisors have edit access to the training database

This commit is contained in:
2022-10-24 16:23:18 +01:00
parent 259932a548
commit c71beab278
9 changed files with 23 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
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: (hasattr(u, 'is_supervisor') and u.is_supervisor) or u.has_perm(perm), login_url=login_url, oembed_view=oembed_view)
def is_supervisor(login_url=None, oembed_view=None):
return user_passes_test_with_403(lambda u: (hasattr(u, 'is_supervisor') and u.is_supervisor))