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

  1. 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.
  2. 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.
  3. 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.
  4. Guard the admin page: In Cursor it redirects non-admins away from /admin and hides admin links in the menu.
  5. 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 guide