Add Administrators
Give another account admin access and remove it when it is no longer needed
If you manage the website yourself, the SUPER_ADMIN_EMAIL setting in the login guide is enough. Use this page when another person needs admin access.
Manage other users
- Sign in as an administrator and open
/admin/users. Find the registered user. - Open role assignment in the user actions, select the existing
adminrole, and save. - Sign in with the target account and confirm it can open
/admin/.
For a small group, you can also add their registered emails to SUPER_ADMIN_EMAIL, separated by commas. Restart locally or update the production Worker secret. Remove an email when that person should no longer have this access; also remove any admin role assigned to them.
If the role list is empty, initialize it using the optional steps below. These commands work on the deployed site's database. For local testing, use SUPER_ADMIN_EMAIL.
Initialize remote roles (optional)
Migrate remote D1 first and make sure the target account is registered in the remote app. In Cloudflare Dashboard, copy your account ID and D1 database ID, then create an API Token with D1:Edit permission for that database. Add these to .dev.vars:
CLOUDFLARE_ACCOUNT_ID=your-account-id
CLOUDFLARE_D1_DATABASE_ID=your-remote-database-id
CLOUDFLARE_API_TOKEN=your-d1-api-tokenConfirm that the database ID belongs to the site you want to manage, then run:
pnpm rbac init
pnpm rbac list-roles
pnpm rbac assign -e admin@example.com -r admin
pnpm rbac list-user-roles -e admin@example.comFor a temporary grant or revocation:
pnpm rbac assign -e admin@example.com -r admin -d 30
pnpm rbac revoke -e admin@example.com -r adminBefore sharing access
Both admin and super_admin currently grant broad admin access. The project does not provide an out-of-the-box role that can only view orders or only manage credits. Use the user ban action to ban an account; assigning a role named banned does not do this.
If you need limited access, give your AI coding tool a specific task:
Add a support role that can only view orders. Restrict both admin pages and the related actions, and verify access using a support account, an administrator, and an ordinary user.
Check the finished restrictions before giving someone that role. For everyday settings, continue to configuration.