In plain words
Logging in (authentication) proves who someone is; permissions (authorisation) decide what they may see or change, and your server must check both.
Where you see it
Maya is logged in to Quill and opens /notes/42. The note loads, but it belongs to someone else: the app checked that she was logged in, never that the note was hers.
What goes wrong
- Hiding the admin button and calling it security
The button is gone, but the admin API route still answers anyone who calls it. Every route needs its own check on the server.
- Checking login but not ownership
Change 42 to 43 in the URL and someone else's note appears. Being logged in says nothing about whose data it is.
- Taking the user ID from the request
If the server reads userId from what the browser sends, anyone can claim to be anyone. Get the user from the session, on the server.
const userId = body.userId;
What to tell your agent
Quick check
Sign in to earn +10 XP for itA Guildhall member changes /members/12/edit to /members/13/edit and can now edit someone else's profile. What's missing?