Skip to main content

Overview

Admin users manage the store via the Admin Panel. They have roles that control what they can access.

Roles

Admin users can have different roles that control their permissions:
RoleDescription
adminFull access to all Admin Panel features
You can create custom roles with specific permissions. See the Customize Permissions guide for details.

Creating Admin Users

Use the Spree CLI to create admin users:
spree user create
The CLI will prompt you for the email and password. You can also pass them directly:
spree user create --email admin@example.com --password secret123
The created user gets the admin role on the default store.

Inviting Admin Users

You can invite new admins through the Admin Panel or programmatically. Via Admin Panel:
  1. Navigate to Settings → Users
  2. Click Invite User
  3. Enter the email address and select a role
  4. Click Send Invitation
The invitee receives an email with an invitation link. If they already have an account, they log in to accept. Otherwise, they create an account first.

Invitation Details

AttributeDescription
emailInvitee’s email address
tokenSecure token for the invitation link
statuspending or accepted
expires_atExpiration date (default: 2 weeks)
resourceThe store being granted access to
roleThe role to assign upon acceptance

Invitation Events

The invitation system publishes events you can subscribe to:
EventDescription
invitation.createdInvitation was created (triggers email)
invitation.acceptedInvitation was accepted and role assigned
invitation.resentInvitation was resent to the invitee

Permissions

Spree uses CanCanCan for authorization. Permissions apply to both customers (Store API access) and admins (Admin Panel access). See the Customize Permissions guide for details on creating custom roles and permission sets.
  • Customers — Customer accounts and authentication
  • Stores — Multi-store setup
  • Permissions — Roles and authorization
  • Events — Subscribe to invitation events