-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add researcher codes #197
Add researcher codes #197
Conversation
lkeegan
commented
Dec 5, 2024
- backend
- add ResearchGroup model with 6-digit id code for users to use when signing up
- add checkdigit dependency to add checksum to code
- add full_data_access flag to users if they should have research access to all data
- admin frontend users tab
- add reseach_group_id & full_data_access to table
- add button to add create a research code for a researcher
- frontend
- add ResearchCodeInput input which checks the entered code checksum is valid
- add optional code input to user signup, remove role selection
- make url for signup /signup
- add optional code e.g. /signup/123451 to allow researchers to send sign-up links to their users with code pre-filled
- add cdigit dependency to validate codes
- resolves Research users should have a code #185
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #197 +/- ##
==========================================
+ Coverage 33.92% 34.60% +0.68%
==========================================
Files 107 109 +2
Lines 3664 3742 +78
Branches 93 94 +1
==========================================
+ Hits 1243 1295 +52
- Misses 2343 2368 +25
- Partials 78 79 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good.
- Wrt the optional code in the signup link: Could this functionality potentially be misused if the link is accidentally sent to a wrong person for example? Are these signup links valid forever?
- does the checksum mechanics have additional use cases (in the research data download perhaps?)
yes the code is valid forever, and associates the user with the researcher. But what we should do is check that the provided code is an existing research code & if not maybe just remove it, to avoid the unlikely scenario where a user signs up with a random valid code, and later a researcher is created with by coincidence exactly this code |
524782a
to
06ec581
Compare
- backend - add ResearchGroup model with 6-digit id code for users to use when signing up - add checkdigit dependency to add checksum to code - add full_data_access flag to users if they should have research access to all data - admin frontend users tab - add reseach_group_id & full_data_access to table - add button to add create a research code for a researcher - frontend - add ResearchCodeInput input which checks the entered code checksum is valid - add optional code input to user signup, remove role selection - make url for signup /signup - add optional code e.g. /signup/123451 to allow researchers to send sign-up links to their users with code pre-filled - add cdigit dependency to validate codes - resolves #185
…likely) scenario with unintentional sharing of data
…tching databases used in user.py
14e7bf1
to
d5de23b
Compare
Quality Gate passedIssues Measures |