In Supabase, you want to allow users to update only their own profile data. Which policy condition correctly enforces this?
Think about how to match the logged-in user with the data owner.
The condition auth.uid() = profile.user_id ensures only the user who owns the profile can update it.
You have a table with no delete policy defined in Supabase. What happens when a user tries to delete a row?
Consider the default behavior when no policy is set.
Without a delete policy, Supabase denies all delete operations by default for security.
Which of the following Supabase update policies correctly allows updates only if the user is authenticated and owns the row?
Both using and check must enforce ownership.
The using clause filters rows the user can see, and check validates the update. Both must confirm ownership.
You want to prevent users from deleting rows they do not own. Which policy condition should you add to the delete policy?
Match the logged-in user ID with the row owner ID.
The condition auth.uid() = owner_id ensures only the owner can delete their rows.
You manage a multi-tenant app where each tenant's data is separated by tenant_id. Which combined policy setup ensures users can update and delete only their tenant's data?
Both user ownership and tenant matching must be enforced in both policies.
Option B correctly enforces that the user owns the row and belongs to the tenant for both update and delete operations.
