Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4CE DUA, institutional officials/members; PDF agreement forms #695

Merged
merged 5 commits into from
Aug 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(projects): Allows automatic access for user covered by an institu…
…tional signer that has access
b32147 committed Aug 21, 2024
commit 7f4685c877f07d99cd9a230911cf0da745da6f0e
15 changes: 15 additions & 0 deletions app/projects/views.py
Original file line number Diff line number Diff line change
@@ -931,6 +931,21 @@ def is_user_granted_access(self, context):
considered having been granted access to participate in this DataProject.
Returns a boolean.
"""
# Check for institutional access
try:
member = InstitutionalMember.objects.get(official__project=self.project, email=self.request.user.email)
logger.debug(f"Institutional member found under official: {member.official.user.email}")

# Check if official has access
official_participant = Participant.objects.get(project=self.project, user=member.official.user)
if official_participant.permission == "VIEW":
logger.debug(f"Institutional official has access, granting access to member")
return True
else:
logger.debug(f"Institutional official does not have access")

except ObjectDoesNotExist:
logger.debug(f"No institutional member found")

# Does user not have VIEW permissions?
if not context['has_view_permission']: