-
Notifications
You must be signed in to change notification settings - Fork 0
Study Admins #651
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
base: dev
Are you sure you want to change the base?
Study Admins #651
Conversation
|
I've disabled some features to do with Redcap and mailer config due to conflict with another PR |
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.
Pull Request Overview
This PR implements a new "Study Admin" role to enable more granular access control within the application. Organization Admins can now delegate study-specific administrative privileges to Study Admins, who have restricted access limited to the studies they manage.
Key Changes:
- Added
StudyAdminrole with permissions limited to assigned studies - Study Admins can create other Study Admins and manage participants/surveys within their studies
- Updated authentication to check study-specific permissions and restrict access accordingly
Reviewed Changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
application/backend/prisma/schema.prisma |
Added StudyAdmin role enum and many-to-many relationship between Users and Studies |
application/backend/src/authentication.ts |
Modified JWT authentication to fetch and validate study-specific permissions |
application/backend/src/controllers/UsersController.ts |
Added endpoints to manage study admin assignments and enforce role-based restrictions |
application/backend/src/controllers/StudiesController.ts |
Filtered study access based on user permissions |
application/backend/src/controllers/ProfilesController.ts |
Added permission checks for profile access across studies |
application/backend/src/controllers/ParticipantsController.ts |
Restricted participant access to assigned studies |
application/backend/src/controllers/FamiliesController.ts |
Added cross-study permission validation for family operations |
application/admin-client/src/providers/authProvider.ts |
Updated to store and manage user role and ID in localStorage |
application/admin-client/src/pages/users/list.tsx |
Added role-based UI restrictions and study admin tooltips |
application/admin-client/src/pages/users/edit.tsx |
Implemented study assignment UI with checkboxes for Study Admins |
application/common/testing/seed.ts |
Added test data for Study Admin user |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Also, I have added a test study admin user '[email protected]' which will be useful for testing this feature. |
Resolves #412
Admin users page:
https://garvan-data-science.slack.com/archives/C044Z3WEBUN/p1762405069210759