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

Staff Dashboard: refactor deactivations and add ability to deactivate fosterers and adopters #1106

Open
kasugaijin opened this issue Oct 31, 2024 · 6 comments
Assignees
Labels

Comments

@kasugaijin
Copy link
Collaborator

kasugaijin commented Oct 31, 2024

Staff (superadmin) can currently deactivate other staff. We also want to enable deactivation of fosterers and adopters.
We currently have a custom action on the Organizations::Staff::Staff controller but I think we can move activations to its own resource to handle for all users. We will also need a new policy, and in the update action/policy check, we just need to determine if the record being mutated is a staff or adopter/fosterer and check for the appropriate user permission. See the video for my thoughts!

https://www.loom.com/share/449c8f3c439b4e01998d472812960d70?sid=98ac012d-ec6c-411a-b857-db8e4c07ba5a

@kasugaijin kasugaijin added the Ready Make a comment to get assigned. label Oct 31, 2024
@kasugaijin
Copy link
Collaborator Author

@wandergithub this one? It has some UI but it's nothing new. Just copy what's done already. Has a good bit of back end refactoring.

@wandergithub
Copy link
Contributor

I want it! seems interesting.

@kasugaijin kasugaijin removed the Ready Make a comment to get assigned. label Nov 9, 2024
@wandergithub
Copy link
Contributor

One question: If im using authorize! @staff how do I make action policy to look at the activations_policy instead of user_policy where it is currently going @kasugaijin

@kasugaijin
Copy link
Collaborator Author

One question: If im using authorize! @staff how do I make action policy to look at the activations_policy instead of user_policy where it is currently going @kasugaijin

Have you tried setting the policy using with: ? we have a few uses of this in the app
docs: https://actionpolicy.evilmartians.io/#/behaviour?id=policy-lookup

@wandergithub
Copy link
Contributor

great that's what i was looking for

Copy link

This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.

@github-actions github-actions bot added the Stale label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants