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

dbGaP application views for PIs #599

Merged
merged 41 commits into from
Jun 18, 2024
Merged

Conversation

amstilp
Copy link
Contributor

@amstilp amstilp commented Jun 7, 2024

Allow PIs to see information about their dbGaP applications.

  • Allow the PI of an application to access the dbGaPApplicationDetail view for that application.
  • Allow the PI of an application to access the dbGaPDataAccessSnapshotDetail view for snapshots associated with the application.
  • Allow the PI of an application to access dbGaPDataAccessRequestHistoryDetail view for DARs associated with the application.
  • Add a field to dbGaPApplication that tracks users covered under the application (even if they haven't linked their accounts).
  • Add a form/view to edit dbGaPApplication collaborators (staff edit only)
  • Show the list of covered users, whether they have a linked account, and whether htey are in the access group on the dbGaPApplicationDetail page.
  • Add a view to audit dbGaP access group membership using the previous field.
  • Also allow anyone covered under the dbGaP information to see the same views as the PI.
  • Add to user profile

amstilp added 6 commits June 6, 2024 11:58
Add a mixin that checks if the user has Staff View permission or
is the PI of the application in question. Update the context and
template to show links based on permission level.
As part of this update, rework the new view mixin to require views
to implement a "get_dbgap_application" method. This method already
existed for dbaPDataAccessSnapshotDetail; I had to add it for the
dbGaPApplicationDetail view. Note that database queries are not
optimized here, so many of the views are making multiple queries
for the same object.
Since the viewmixin sets self.dbgap_application, we can use that
attribute in the view without having to make additional database
queries.
Rework the url and view such that both the dbgap_application and
the DAR id are required. This should be unnecessary (e.g., a DAR id
is only associated with a single dbGaP application at dbGaP), but it's
a little safer and it's easier to check if the user has permission
to see the page.
Copy link

codecov bot commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 99.93141% with 1 line in your changes missing coverage. Please review.

Project coverage is 98.83%. Comparing base (2e72dd8) to head (d96949e).
Report is 43 commits behind head on main.

Files Patch % Lines
primed/dbgap/viewmixins.py 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #599      +/-   ##
==========================================
+ Coverage   98.73%   98.83%   +0.09%     
==========================================
  Files         300      307       +7     
  Lines       23850    25838    +1988     
==========================================
+ Hits        23549    25536    +1987     
- Misses        301      302       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@amstilp amstilp changed the title dbGaP application views for pis dbGaP application views for PIs Jun 7, 2024
amstilp added 22 commits June 7, 2024 11:25
This field allows the CC to set the collaborators for a dbGaP
Application, even if the users have not linked their AnVIL accounts.
This is in preparation for adding a table of collaborators.
This table will be used on the dbGaP application page to show
the list of collaborators, their AnVIL accounts, and whether or not
the user is a member of the access group.
This table shows the list of named collaborators, their AnVIL account
(if linked), and whether the account is a member of the access group.
We're going to add an audit for dbGaP application collaborators, so
rework the current audits to include "access" in the namespace and
urls.
Also rename some of the audit classes and views to include "Access"
in the name. This will help when we add a collaborator audit, and
matches how the audit is done for CDSAs.
Add skeleton classes for the collaborator audits, mostly copy-pasted
from the access audits. Add views that currently do nothing, some
urls for those views, and test classes with one failing test. These
will be fleshed out in future commits.
Write the class definitions for dbGaPCollaboratorAudit and related
classes (audit results, tables). Also add some tests; other tests
can be added once the views are closer to working.
Also some other temporary changes while working on the view
definition.
Also make changes as necessary to other classes/templates. Update
the template to pass the correct arguments to resolve. Use the
template column in the table now that it's working to handle the
resolution and links.
This is simple, and just adds an error for the group. It is useful
in the audit resolve view, which needs to call a sub-method to audit
a specific application and member.
This lets us have one method that can be called to audit a given
application and user/account/group/email record, which will be
useful in the audit resolve view.
Use the admins group specified in the settings file to decide whether
or not to ignore groups in the various audits. The audits for both
collaborative_nalysis and dbgap collaborators had to be updated.
Then my laptop won't have all its CPU taken up during the tests.
amstilp added 13 commits June 14, 2024 15:28
In addition to allowing PIs to see information about a dbGaP
application (DAR status, etc), also allow collaborators to see it.
Update the view mixin to check if a user is either a PI or a
collaborator, and then grant access appropriately.
Also rearrange the nav item order such that similar things are near
each other..
Forgot to add it in an earlier branch, so just add it now.
It was resolving the dbGaP url, not the collab analysis url. This
is only an issue in the message that's printed out or emailed, so
not a big deal to have it wrong before.
Add a statement on the user profile page when there are no associated
dbGaP applications for a given user.
ACM staff view users should be able to see the data access mechanisms
for a given user. Update the template and tests to ensure this is
the case.
Also rearrange the way the information is displayed in order to
better separate dbGaP and CDSA information.
@amstilp amstilp marked this pull request as ready for review June 18, 2024 22:27
@amstilp amstilp merged commit 175ef59 into main Jun 18, 2024
11 checks passed
@amstilp amstilp deleted the feature/dbgap-application-views-for-pis branch June 18, 2024 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant