There's an issue that appears when users have multiple roles and were invited by different people.
Consider the following case:
User is invited as Fellow by one NFP.
User is invited as Coach by another Fellow.
User invites a Volunteer to platform.
When listing on VolunteersController#index, the new volunteer will not be listed because current_user_role is a Fellow, and since this user's Coach role is under another, the chain of relationships is broken.
Possible fix: When adding an existing user to another role, override default behaviour and:
If new role is one step lower than current role, assign current role as parent.
If new role is one step higher than current role, assign old role's parent as new one.
If new role is two steps away, block it and demand that the intervening position be filled.
☝️ Haven't thought too much about this though - there might be holes in the logic.
There's an issue that appears when users have multiple roles and were invited by different people.
Consider the following case:
Fellow
by one NFP.Coach
by anotherFellow
.Volunteer
to platform.VolunteersController#index
, the new volunteer will not be listed becausecurrent_user_role
is aFellow
, and since this user'sCoach
role is under another, the chain of relationships is broken.Possible fix: When adding an existing user to another role, override default behaviour and:
☝️ Haven't thought too much about this though - there might be holes in the logic.