-
Notifications
You must be signed in to change notification settings - Fork 65
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
how to delete a team account? #87
Comments
1. Add new policy on basejump.accounts"Account can be deleted by primary owner" with check " (primary_owner_user_id = auth.uid())" 2. Expose basejump scheme from APIGo to settings -> Api -> Exposed schema and add basejump here !! Warning, make sure your policies are correct. I did only a brief check and it seems basejump has sane defaults, but the risk is on you. 3. Query from client using basejump and not public schema
|
We do not wish to expose the entire basejump schema public as mentioned above. Is there a function / rest api to delete the team? |
@airsherlock I think you'd have to write the function yourself. Something like this: **
Allows an owner to delete an existing account
*/
create or replace function public.delete_account(account_id uuid)
returns void
language plpgsql
as
$$
begin
-- verify account owner for the account
if basejump.has_role_on_account(
delete_account.account_id, 'owner') <>
true then
raise exception 'Only account owners can delete accounts';
end if;
delete from basejump.accounts where id = delete_account.account_id;
end
$$;
grant execute on function public.delete_account(uuid) to authenticated;
|
I couldn't find the API to delete a team account on base jump docs. Please help me out.
The text was updated successfully, but these errors were encountered: