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

Fix the tag editing capabilities of everyone on a partner #2207

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

r-ferrier
Copy link
Contributor

fixes #2174

Description

  • ensures root users can still add/remove any tag
  • ensures partner admins can still add any category or facility tag and remove any partnership tags
  • allows partnership admins to edit tags without accidentally removing tags they can't see in the process
  • prevents partnership admins from removing partnership tags that don't belong to them
  • warns partnership admins if tag removal is likely to boot a partner out of their scope

Implementation notes

I've used a bespoke select2 style controller for this again, like we did for controlling the partners that users admin for. This is mainly so there is instant and obvious feedback, and because we don't actually need to make these moves impossible at a database level, we just want to ensure admin users are fully aware of how certain actions will impact their reach.

I've added tests for the new methods in the helper but not for the JS logic for the same reasons mentioned in the related PR.

(related PR here)

Copy link
Contributor

@ivan-kocienski-gfsc ivan-kocienski-gfsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice, good work.

(Didn't know you could def policy_scope in tests like that)

@r-ferrier r-ferrier merged commit e743642 into main Jan 23, 2024
2 checks passed
@r-ferrier r-ferrier deleted the feat/2174-partnership-admins-edit-scope branch January 23, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants