-
Testing
Test every endpoint against every user role
Build a permissions matrix test proving users can only do and see what their role allows.
Free Prompt
My app has different kinds of users (even if it's just free vs paid, or user vs admin) and I want proof that permissions actually hold everywhere.
First, map the permission surface: list every endpoint, route, or server action in my app, and note which roles or account states should be able to use it (anonymous, free, paid, admin, owner vs non-owner of a resource). Show me the matrix before writing tests so I can correct any wrong assumptions.
Then write tests that walk the matrix:
1. Every protected endpoint rejects anonymous requests.
2. Every role-restricted endpoint rejects users without that role.
3. For resources owned by a user (their posts, their orders, their files), one user cannot read, modify, or delete another user's resources, including by guessing IDs.
4. Paid-only features reject free users at the server level, not just by hiding buttons in the UI.
5. Admin-only actions reject normal users.
The important cases are the negative ones. A test proving an admin can access the admin panel is worth a lot less than a test proving a free user can't.
If you find an endpoint with no permission check at all, stop and flag it before writing its test. That's a finding, not a test case.
When done, run the suite and give me the final matrix with pass/fail per cell.
What This Does / How This Helps
This builds a permissions matrix test: every endpoint checked against every role, with emphasis on the negative cases like users accessing each other's data by guessing IDs. Broken access control is the most common serious vulnerability in small apps, and vibe-coded apps are especially prone because AI tools default to making things work, not making things forbidden. One missing ownership check on an endpoint like `/api/orders/:id` means every customer's data is public to anyone logged in. A matrix test turns that class of bug into a checklist instead of a hope.
Want to skip doing this by hand?
Fortivibe audits your app for all of the areas these prompts cover (and more).