Then comes a question sign-in doesn't answer at all: what each user may do after they're in.
Two words that sound alike
Authentication is who you are. The system checks that you really are who you say.
Authorization is what you may do. The system checks whether you may see this booking, edit this product, delete this customer.
A system with sign-in and no permissions is a door with a lock, where everyone who comes through gets a key to every room.
The AI almost always builds the first. It builds the second only when asked, and sometimes it builds it in the wrong place.
The wrong place: the button
The most common way systems built fast "restrict" users is to hide buttons. A manager sees a "delete" button, a customer doesn't. Looks tidy.
But the button is only a drawing on the screen. Behind it is a request sent to the server, and whoever knows how to send it themselves doesn't need the button. And that no longer takes a hacker: today any user can ask an AI agent to do it for them. I wrote about it here.
So there's one rule: permission is enforced on the server, not on the button. In Supabase this is called RLS, rules that sit inside the database itself and check every request. Full explanation here.
The decisions
What the user types are. Customer, agent, manager, business owner. Every extra type is another row in every decision. So it's worth starting with as few as possible, and adding when really needed.
What each type may do, and whose it is. A customer sees their own bookings. Does an agent see all bookings, or only theirs? And who may cancel a customer's booking? The button exists, the question is who it works for. The full case here.
What about files. A customer uploaded a photo of their ID. Who can open the link? The AI, so that it works fast, sometimes puts it in a public folder. The link is long and random, so it feels private. It isn't. The full case here.
One business or many. If the system serves several businesses, each with its own customers, this is the heaviest decision at this step. A mistake here doesn't mean a user sees something they shouldn't. It means one business sees another business's customers.
What's a pipe and what's a wall
- Pipe: what the login screen looks like, whether there's Google sign-in, how password reset works.
- Wall: who sees what, where it's enforced, and what separates one business from another. Once someone's data has been exposed to someone else, no prompt brings it back.
And the price here isn't only technical. Exposed personal data is a trust event, and sometimes a legal one too.
What to ask the AI
Write me a table: for each user type, what they may see, create, edit and delete, and whose. Enforce each one on the server or in the database, not only in the interface. And tell me where you assumed a permission I didn't ask for.
How you know it holds
Here the check has to come from outside, like an attacker, not from inside the interface:
- Sign in as one user, and try to open another user's booking directly, without a button.
- Sign in as a customer, and send the request behind a manager's "delete" button.
- Open a link to a private file without being signed in.
Every such attempt should fail. If one of them succeeds, the permission lives in the button.
The question isn't whether the user sees the button. The question is what happens when they send the request without it.
The security skill runs exactly these checks from the outside, and first asks you the decisions security depends on. Previous in the series: data. Next: money.