User Management
Learn how to manage users in your MkSaaS website
This guide covers the user management system in your MkSaaS website, including user roles, permissions, and administrative actions.
Core Features
The MkSaaS template provides a powerful user management system with the following features:
- Advanced user search and filtering
- Pagination with customizable page size
- Sortable columns and column visibility control
- User role and account status management
- Stripe customer integration
- User ban/unban functionality with reason and expiration
- Responsive design for mobile devices
- Internationalization (i18n) support
User Management Interface
The user management interface is accessible through the dashboard (for admins only by default), and provides a comprehensive view of all users in the system.
The user table includes the following features:
- Search and Filtering: Use the search bar to find users by name or email
- Pagination: Navigate through user records with customizable page sizes (10, 20, 30, 40, 50)
- Column Sorting: Click column headers to sort by that field
- Column Visibility: Toggle which columns are displayed using the columns dropdown
- Responsive Design: Table adapts to different screen sizes
- Dark Mode: Automatically adjusts to system theme preferences
User Roles and Permissions
MkSaaS supports two user roles: admin
and user
.
You can create a new role by following the instructions in the Roles | BetterAuth documentation.
You can also add permissions to the roles to control what actions users can perform by following the instructions in the Permissions | BetterAuth documentation.
Setting Up an Admin User
To set up an admin user:
-
Access your database using Drizzle Studio:
-
Navigate to the
user
table -
Find the user you want to make an admin
-
Update the
role
field to'admin'
-
Save the changes
The user will now have administrative privileges.
User Ban Management
Banning a User
To ban a user:
- Click on the user's name in the user table to open the detail drawer
- 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 unable to log in.
Unbanning a User
To unban a user:
- Click on the user's name in the user table
- In the user detail drawer, click the "Unban User" button
The user's ban will be lifted immediately.
Ban Features
- Permanent Ban: Leave the expiration date empty
- Temporary Ban: Set an expiration date using the calendar picker
- Ban Reason: Required field explaining why the user was banned
Stripe Customer Integration
For users with Stripe customer accounts:
- Click the customer ID of the user to open the Stripe dashboard
- View customer details and payment history
Next Steps
Now that you understand user management in MkSaaS, explore these related topics: