Watch: Give myself an admin role other users can't get | Vovy
Watch Vovy do it on a Mac: "Make me an admin and hide the admin page from everyone else". Vovy adds a role to your account that users can't edit, locks the admin page and its data behind it, and proves a regular user is blocked.
"Make me an admin and hide the admin page from everyone else"
Vovy adds a role to your account that users can't edit, locks the admin page and its data behind it, and proves a regular user is blocked.
What happens in the video
- Pick where the role lives: Vovy explains with a card why the role goes in app_metadata, which only your server can change, and never in user_metadata, which any logged-in user can edit.
- Set your account as admin: It runs a small SQL update in the Supabase SQL Editor that adds role: admin to your user's app_metadata.
- Lock admin data with policies: Vovy adds Row Level Security policies, rules the database checks on every request, that let only tokens with the admin role read admin tables.
- Guard the admin page: In Cursor it redirects non-admins away from /admin and hides admin links in the menu.
- Prove a normal user is blocked: Vovy logs in as a test user, visits /admin, and tries the data directly, then shows a card of what was blocked.
Read the step-by-step guideLoading...