You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Group membership and pending membership management #36
# app/controllers/group_members_controller.rbmoduleApimoduleV1classGroupMembersController < BaseControllerdefindex# GET /groups/:id/members## Shows all the current members of this groupenddefcreate# POST /groups/:id/members## Creates a new member for this group# IF this user is a pending member of this groupenddefdestroy# DELETE /groups/:id/members## Deletes a member from this groupendendendend
# app/controllers/pending_members_controller.rbmoduleApimoduleV1classPendingMembersController < BaseControllerdefindex# GET /groups/:id/invited## Shows all the invited users of this groupenddefcreate# POST /groups/:id/invited## Invites a user to this group# IF the currently logged in user is a member of this group# AND the invited user is NOT already a pending member OR current member of this groupenddefdestroy# DELETE /groups/:id/members## Deletes the invitationsendendendend
def create
# POST /groups/:id/members
#
# Creates a new member for this group
# IF this user is a pending member of this group
end
I think this creates sort of a feeling that you can create a member directly. where this is not true. You can only invite someone, and that someone, can accept the invitation.
I think if we go ahead and say that to accept the invitation, you go to PUT /groups/:id/invited and send accepted=true / accepted=false this will be better.
Then a the user moved form invited to members or deleted from invited.
I think it's bit more concise with what's actually going on.
What do you think ?
We can make it so you can delete the invitation, with the delete, if it's been sent already but user hasn't got a change to accept it.
Ok sounds like a good idea too, but the idea was that in the end you are creating the resource GroupMember
Otherwise we would create a GroupMember resource in the PendingMember resource. Do you know what I mean? I am not objecting your idea, but I am also not very sure which way to go.
But you are not really creating group member per say, as you do not have power to do so. A group member is an outcome of you creating invitation and invited person accepting it. That is my way of thinking about it. My intuition is that POST group/:id/members is not proper as you are not creating it. No one can go and actually make a group member. You must invite someone, and that person must accept invitation. There isn't a situation where you can actually just go ahead and create member. I think doing it that way is a bit confusing, where as just accepting membership, with PUT group/:id/invited?accepted=true is more clear. But that's just my idea.
Activity
tsov commentedon Jul 8, 2013
update! I just edited the issue
foFox commentedon Jul 9, 2013
About that
I think this creates sort of a feeling that you can create a member directly. where this is not true. You can only invite someone, and that someone, can accept the invitation.
I think if we go ahead and say that to accept the invitation, you go to PUT /groups/:id/invited and send accepted=true / accepted=false this will be better.
Then a the user moved form invited to members or deleted from invited.
I think it's bit more concise with what's actually going on.
What do you think ?
We can make it so you can delete the invitation, with the delete, if it's been sent already but user hasn't got a change to accept it.
tsov commentedon Jul 9, 2013
Ok sounds like a good idea too, but the idea was that in the end you are creating the resource GroupMember
Otherwise we would create a GroupMember resource in the PendingMember resource. Do you know what I mean? I am not objecting your idea, but I am also not very sure which way to go.
foFox commentedon Jul 9, 2013
But you are not really creating group member per say, as you do not have power to do so. A group member is an outcome of you creating invitation and invited person accepting it. That is my way of thinking about it. My intuition is that POST group/:id/members is not proper as you are not creating it. No one can go and actually make a group member. You must invite someone, and that person must accept invitation. There isn't a situation where you can actually just go ahead and create member. I think doing it that way is a bit confusing, where as just accepting membership, with PUT group/:id/invited?accepted=true is more clear. But that's just my idea.
tsov commentedon Jul 20, 2013
#34
tsov commentedon Jul 24, 2013
https://redmine.eventhub.com/issues/19