Skip to content

Commit 6b31ff6

Browse files
Twonarly1hobbescodescoopbri
authored
Invite org member (#41)
* feat: implement a invitation table to store invites by email * feat: implement a invitation table to store invites by email * feat: add email to user table and update auth hooks * chore: create initial invitation RBAC plugin * refactor: invitation RBAC plugin * refactor: invitation RBAC plugin * refactor: condesnse all migration files into 1 migration * chore: update the invitation RBAC plugin to handle more scenarios not to send invitations * chore: update the invitation RBAC plugin to handle more scenarios not to send invitations * chore: add additional indexes on invitation table * chore: extend the RBAC plugin for both create and delete scopes * chore: update invitations plugin to allow admin or owner the ability to invite members * chore: update invitations plugin to allow admin or owner the ability to invite members * chore: update comments and error messages * Update src/lib/plugins/postgraphile/InvitationRBACPlugin.ts Co-authored-by: hobbescodes <[email protected]> * Update src/lib/plugins/postgraphile/InvitationRBACPlugin.ts Co-authored-by: Brian Cooper <[email protected]> --------- Co-authored-by: hobbescodes <[email protected]> Co-authored-by: Brian Cooper <[email protected]>
1 parent 2ff0668 commit 6b31ff6

File tree

9 files changed

+6898
-2875
lines changed

9 files changed

+6898
-2875
lines changed

src/generated/graphql/schema.executable.ts

Lines changed: 5408 additions & 2875 deletions
Large diffs are not rendered by default.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CREATE TABLE "invitation" (
2+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3+
"organization_id" uuid NOT NULL,
4+
"email" text NOT NULL,
5+
"created_at" timestamp(6) with time zone DEFAULT now(),
6+
"updated_at" timestamp(6) with time zone DEFAULT now(),
7+
CONSTRAINT "invitation_email_unique" UNIQUE("email")
8+
);
9+
--> statement-breakpoint
10+
ALTER TABLE "user" ADD COLUMN "email" text NOT NULL;--> statement-breakpoint
11+
ALTER TABLE "invitation" ADD CONSTRAINT "invitation_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
12+
CREATE UNIQUE INDEX "invitation_id_index" ON "invitation" USING btree ("id");--> statement-breakpoint
13+
CREATE UNIQUE INDEX "invitation_email_index" ON "invitation" USING btree ("email");--> statement-breakpoint
14+
CREATE INDEX "invitation_organization_id_index" ON "invitation" USING btree ("organization_id");--> statement-breakpoint
15+
ALTER TABLE "user" ADD CONSTRAINT "user_email_unique" UNIQUE("email");

0 commit comments

Comments
 (0)