code-corps-api icon indicating copy to clipboard operation
code-corps-api copied to clipboard

Add InvitedUser model, policy, and controller

Open joshsmith opened this issue 7 years ago • 1 comments

Problem

We want to add an InvitedUser with the following attributes:

  • email - string; required
  • role - string; optional
  • name - string; optional

And the following relationships:

  • invitee - optional; eventually set to the user created from this invite
  • inviter - required; the user who created the invite
  • project - optional; the project the invite is for

We’ll need create, update, index and show endpoints.

If inviting to a project, the policy should check permissions similar to how ProjectUser works.

When the invite flow is complete, ie to claim an invite, we’ll need to:

  • create a user
  • set the invited_user’s invitee_id
  • create a project_user for the project with the specified role

It may make sense to do this on the user create endpoint by specifying the InvitedUser id as a relationship.

joshsmith avatar Dec 28 '17 14:12 joshsmith

Sorry for adding to this bug. Trying to get the attention of @joshsmith regarding another repo but all the emails are bouncing. @joshsmith could you reach at me?

theochino avatar Dec 07 '21 13:12 theochino