Add role-based access: Free AI Prompt | SheCodes

Free AI prompt · The Code Book

Add role-based access

A ready-to-use prompt from the chapter Authentication. Paste it into Claude, ChatGPT, Lovable, Bolt or any AI coding tool.

The prompt

“Add user roles to my app (admin, editor, viewer). Admin users can access the /admin page. Editors can create and edit content. Viewers can only read. Show different navigation items based on role.”

How to use it

  1. Copy the prompt and paste it into your AI coding tool.
  2. Check the result in the preview, then ask for changes one at a time: "make the buttons bigger", "use my brand colours".
  3. Read the chapter to understand why it works and what to do next.

More prompts like this

All prompts

AI Prompts for Auth

“Add Google and GitHub login to my app using Clerk. Create a sign-in page and a sign-up page with social login buttons.”

AI Prompts for Auth

“Add a user avatar button to the top-right corner of my navbar. When clicked, show a dropdown with profile, settings, and sign-out options.”

AI Prompts for Auth

“Add email and password login to my app using Better Auth. Include a custom sign-in page with email and password fields.”

Add auth with clerk

“Add user authentication to my Next.js app using Clerk. Include sign-up, sign-in, and a protected dashboard page. Add Google and GitHub as social login options.”