This commit is contained in:
Ross
2021-04-29 23:04:50 +01:00
parent ccce139bd9
commit d414823c72
+8
View File
@@ -146,6 +146,14 @@ class ExamViews(View, LoginRequiredMixin):
self.loadJsonAnswer = loadJsonAnswer
def check_user_access(user):
"""Check if a user should be able to access a view
Args:
user ([user]): user object
Returns:
[boolean]: True if the user has access
"""
if self.app_name == "rapids" and not user.groups.filter(name='rapid_checker').exists():
return False
if self.app_name == "anatomy" and not user.groups.filter(name='anatomy_checker').exists():