Skip to content
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

Add invite feature #7

Closed
bangdragon opened this issue Sep 15, 2023 · 6 comments
Closed

Add invite feature #7

bangdragon opened this issue Sep 15, 2023 · 6 comments
Labels
blocked enhancement New feature or request

Comments

@bangdragon
Copy link

As you said:

I've also recently created an invite system built on this and supabase edge functions which allows group owners to generate a token which other users can use to join their group with a specific pre-selected role. I have not yet extensively tested it but if you are interested in this code as well

Please add this feature. Thanks

@bangdragon
Copy link
Author

I have one question. In this following code:

set check_function_bodies = off;

CREATE OR REPLACE FUNCTION public.set_group_owner()
 RETURNS trigger
 LANGUAGE plpgsql
 SECURITY DEFINER
AS $function$
	begin
		IF auth.uid() IS not NULL THEN 
		insert into public.group_users(group_id, user_id, role) values(new.id, auth.uid(), 'owner');
		end if;
		return new;
	end;
$function$
;

CREATE TRIGGER on_insert_set_group_owner AFTER INSERT ON public.groups FOR EACH ROW EXECUTE FUNCTION set_group_owner();

Why need to set check_function_bodies = off;

@point-source
Copy link
Owner

Why need to set check_function_bodies = off;

Actually, we don't. Feel free to remove or skip that. It gets automatically added by the diff tool when I use supabase's cli to create the migration scripts.

@point-source
Copy link
Owner

Just popping in to say I haven't forgotten this. Just been busy. This is on my to-do list.

@point-source point-source added the enhancement New feature or request label Oct 27, 2023
@nikitastryuk
Copy link

this would be great addition

@point-source
Copy link
Owner

I have added this in the dev branch. An updated TLE is coming soon but is currently blocked by this bug.

@crllnsmnn
Copy link

@point-source First of all - thank you, great work! I am looking forward to this extension!
Is it possible to extend the invitation logic to allow multiple roles when creating the invitation? This would allow more complicated role setups right after invitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants