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
Extend to deal with group managers/leaders? #3
Comments
Hi, You're correct that the gem doesn't currently support this use case. It's one weakness of the relatively simple group membership concept: you're either a member, or you're not. A simplistic solution to your problem would be to set the manager role or type on the user, and assume that a manager in a group is a manager of that group. This isn't a fully generic solution, because that would make the user manager of all groups they belong to, rather than just certain groups. See the specs for examples of implementing this strategy using STI (Single Table Inheritance). Probably the best solution would be to introduce a "membership type" concept. So in addition to being a member of a group, your membership could be of a certain type, i.e. nothing (the default), "manager", "employee", etc. The simplest way to do this in ActiveRecord would be to add a new Doing this in Mongoid would be a bit more complicated. Mongoid stores relations as arrays of ids, and the named groups are stored as an array of symbols, on the member models. We could probably embed group membership types, at the cost of complicating the associated queries. Let me know what you think about these proposed solutions. |
I see - I think I prefer adding a type into the GroupMemberships, I'll have a look and see if I can make it work the way I want. Thanks. |
Please see te |
This is working great so far, how would I extend or use this to deal with managers or leaders of a group?
example - I am using named groups, if I add say 5 users to a group called :team1 how would I set one (or more) as managers of that particular group?
I'm not sure if the gem can handle this currently
The text was updated successfully, but these errors were encountered: