-
Notifications
You must be signed in to change notification settings - Fork 1
Allow providers to edit and delete users they have access to #894
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: main
Are you sure you want to change the base?
Conversation
|
Preview deployment: https://a3-permissions.preview.avy-fx.org |
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.
This change would allow a provider manager to delete/edit any user with a provider relationship regardless of that user's roles or global roles.
This is an issue because we currently have some Sierra admin users with provider relationships to the Sierra Avalanche Center provider in production. So this change would allow a provider manager user to delete a Sierra admin user. Which shouldn't be allowed.
I think what we want is logic that says: a provider manager can:
- read any user with a providers relationship
- edit/delete any user with only a provider relationship and no roles or global roles
Maybe we go to the field level and allow a provider manager to edit a user's providers relationship field if that user already has a provider relationship but that might not be worth it.
Test by adding a providers relationship to a tenant-admin user in the local seed data. The provider manager user can then delete that user.
I am not sure if there is a way we can do this at the access level, since the data being deleted/edited is not available to look at. I added 2 hooks to the user collection to check the user being edited or deleted and not let a provider manager delete a user associated with an avy center. Is there another way to do this? |
Description
As mentioned, we want to give a provider manager permission to:
Related Issues
Resolves #834
Key Changes
Changed permissions for provider managers on
userscollection and add beforeChange and beforeDelete hooksHow to test
EditandDeleteScreenshots / Demo video
https://www.loom.com/share/9a79a65e6cec4e35888171620ed448e4
Migration Explanation
None