LogicTrail
  • Trails
  • Check my app
  • Pricing
  • Sign in
  1. Trails
  2. /
  3. Who may see what
  4. · 4 minutes · Pro

The admin button

Only admins see the Refund button. A regular user has just refunded their own last three orders.

This answers: Is hiding the admin button enough? No coding needed. 3 quick decisions.

  • Who is signed in
  • Who may see what
  • Debugging without panic

Checking your access…

Is hiding the admin button enough?

No. Hiding a button only changes what is shown. Anyone can send the same request without the button. Every sensitive endpoint must check the caller's role on the server, reading that role from your database or a verified session, never from the request body.

Trail of the bug
  1. Browser
  2. Your server
  3. Stripe

Breaks at Your server: Endpoint never checks the role

Why AI tools write this bug

Generated UIs often wrap admin features in a condition like if (user.role === 'admin'), which looks like protection. The endpoint behind it is generated separately and frequently has no check at all.

How to fix it

  1. Check the role inside the endpoint or server action, before doing anything.

3 more steps, and a prompt that checks your own app for this bug. Part of Pro.

Unlock

Common questions

Can I trust a role sent in the request body?
No. Anything in a request was written by the person sending it, including role: 'admin'.

Related scenarios

  • Open it in incognitoPro · 4 min
  • Invoice 105Free · 4 min
  • Launch day, no emailsFree · 4 min

More on this trail

Who may see what: Sign-in, permissions, and the leaks AI-built apps ship most often.

Want someone to look?

We check AI-built apps for this and three other common leaks, in plain English.

Check my app
Sign in

Sign in to walk this one

3 decisions, about 4 minutes, and a prompt to check your own app for the same problem.

Sign in No password. We email you a link.

How to fix it

  1. Check the role inside the endpoint or server action, before doing anything.

3 more steps, and a prompt that checks your own app for this bug. Part of Pro.

Unlock