Skip to content

Commit

Permalink
Updated the Project Access Page to display the policy descriptions co…
Browse files Browse the repository at this point in the history
…nditionally. (#2274)

This PR addresses the confusion created on HDN due to different between
the policy documentation listed and the policy choices available. This
makes the description for each policy conditional to the access policy
being allowed.
  • Loading branch information
tompollard authored Aug 20, 2024
2 parents d129a65 + 51d2bec commit 2417c49
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
8 changes: 5 additions & 3 deletions physionet-django/project/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,9 +825,11 @@ def project_access(request, project_slug, **kwargs):
else:
access_form = forms.AccessMetadataForm(instance=project, editable=editable)


return render(request, 'project/project_access.html', {'project':project,
'access_form':access_form, 'is_submitting':kwargs['is_submitting']})
return render(request, 'project/project_access.html', {
'project': project, 'access_form': access_form,
'is_submitting': kwargs['is_submitting'],
'access_policy_choices': settings.ALLOWED_ACCESS_POLICIES,
})


@project_auth(auth_mode=0, post_auth_mode=2)
Expand Down
19 changes: 15 additions & 4 deletions physionet-django/templates/about/access_policies.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@
metadata of all published projects are publically visible. The following
access policies control access to the files:</p>
<ol>
<li><strong>Open</strong>: Anyone can access the files, as long as they conform to the terms of the specified
{% if "OPEN" in access_policy_choices %}
<li><strong>Open</strong>: Anyone can access the files, as long as they conform to the terms of the specified
<a href="{% url 'static_view' static_url='publish' %}#licenses" target="_blank">license</a>.</li>
<li><strong>Restricted</strong>: Only logged in users who sign a data use agreement (DUA) for the project can access the files.</li>
<li><strong>Credentialed</strong>: Only {{ SITE_NAME }} credentialed users who sign a DUA for the project can access the files. This tier is only for sensitive databases. Please <a href="{% url 'static_view' static_url='about' %}#contact_us" target="_blank"> contact us</a> beforehand if you would like to contribute such a resource.</li>
{% endif %}
{% if "RESTRICTED" in access_policy_choices %}
<li><strong>Restricted</strong>: Only logged in users who sign a data use agreement (DUA) for the project can access the files.</li>
{% endif %}
{% if "CREDENTIALED" in access_policy_choices %}
<li><strong>Credentialed</strong>: Only {{ SITE_NAME }} credentialed users who sign a DUA for the project can access the files. This tier is only for sensitive databases. Please <a href="{% url 'static_view' static_url='about' %}#contact_us" target="_blank"> contact us</a> beforehand if you would like to contribute such a resource.</li>
{% endif %}
{% if "CONTRIBUTOR_REVIEW" in access_policy_choices %}
<li><strong>Contributor Review</strong>: Only {{ SITE_NAME }} credentialed users who sign a DUA and submit a project plan approved by the data contributor may access the files.</li>
{% endif %}
</ol>
<p>We strongly encourage selecting the <strong>open</strong> access policy.</p>
{% if "OPEN" in access_policy_choices %}
<p>We strongly encourage selecting the <strong>open</strong> access policy.</p>
{% endif %}

0 comments on commit 2417c49

Please sign in to comment.