.
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user