File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -931,6 +931,21 @@ def is_user_granted_access(self, context):
931
931
considered having been granted access to participate in this DataProject.
932
932
Returns a boolean.
933
933
"""
934
+ # Check for institutional access
935
+ try :
936
+ member = InstitutionalMember .objects .get (official__project = self .project , email = self .request .user .email )
937
+ logger .debug (f"Institutional member found under official: { member .official .user .email } " )
938
+
939
+ # Check if official has access
940
+ official_participant = Participant .objects .get (project = self .project , user = member .official .user )
941
+ if official_participant .permission == "VIEW" :
942
+ logger .debug (f"Institutional official has access, granting access to member" )
943
+ return True
944
+ else :
945
+ logger .debug (f"Institutional official does not have access" )
946
+
947
+ except ObjectDoesNotExist :
948
+ logger .debug (f"No institutional member found" )
934
949
935
950
# Does user not have VIEW permissions?
936
951
if not context ['has_view_permission' ]:
You can’t perform that action at this time.
0 commit comments