Comments (3)
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 API
Go 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
const { data, error } = await supabase
.schema("basejump")
.from("accounts")
.delete()
.eq("id", workspaceId);
from basejump.
We do not wish to expose the entire basejump schema public as mentioned above.
Is there a function / rest api to delete the team?
from basejump.
@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;
from basejump.
Related Issues (20)
- typo in docs HOT 1
- get_personal_account doesn't include email HOT 2
- Small documentation update HOT 3
- Recommended way to get account_id throughout project? HOT 1
- This project should use the same copy-paste logic as the UI components HOT 1
- Package issue with vite/react causes build error HOT 1
- Cannot run db reset on remote database HOT 2
- Use new Auth Hooks approach? HOT 2
- Can we use basejump with hosted supabase? HOT 2
- Confused on how to use RPC to get account info. HOT 6
- get_account_members function from documentation does not exist HOT 2
- Is there a recommended way to remove or delete a user from a team? HOT 2
- How can I integrate Basejump in an existing DB
- Invitation should have a reference to the invited user
- Webhook doesnt exist even though its in documentation? HOT 2
- Ways to get account ID in API routes for teams or personal.
- Automatically creating API keys and accessing on the backend
- can't create account
- Get currently selected ID
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from basejump.