Skip to content

User Management

This document covers the user management system in the ShipSaaS template, including user roles, permissions, and administrative actions.

The ShipSaaS template contains a user management system with the following capabilities:

  • User searching and filtering
  • Pagination with customizable page sizes
  • Management of user roles and account statuses
  • Ability to ban/unban users

The user management interface is accessible via the dashboard (by default, only accessible by administrators) and lists all users in the system.

The user table includes the following features:

  • Column Visibility: Toggle which columns are displayed using the columns dropdown menu.
  • Search and Filter: Find users by name or email using the search bar.
  • Pagination: Customizable page sizes (10, 20, 30, 40, 50).

The ShipSaaS template supports two user roles by default: admin and user.

You can create new roles by following the instructions in the Roles | Better Auth Documentation.

You can also add permissions to roles to control what actions users can perform, following the Permissions | Better Auth Documentation.

To set a user as an administrator:

  1. Access your database using Drizzle Studio.
  2. Navigate to the user table.
  3. Find the user you want to make an administrator.
  4. Update their role field to admin.
  5. Save the changes; the user will now have admin privileges.

To ban a user:

  1. Click on a user’s name in the user table to open their details.
  2. In the ban section:
  • Enter a reason for the ban.
  • Optionally set an expiration date.
  • Click the Ban User button.

The user will be immediately banned and will no longer be able to log in.

To unban a user:

  1. Click on a user’s name in the user table.
  2. In the user details panel, click the Unban User button.

The user’s ban will be lifted immediately.

Now that you understand user management in the ShipSaaS template, explore these related topics: