Overview
jshERP provides comprehensive user management capabilities including account creation, authentication, role assignment, and profile management. All users are scoped to a specific tenant and inherit that tenant’s permissions and limitations.Users can only be created by administrators and are automatically associated with the current tenant. Each tenant’s user count is limited by their subscription.
User Account Structure
Each user account contains:Unique user identifier
Display name for the user
Username for authentication (must be unique)
Encrypted password (MD5 hashed)
User email address
Contact phone number
Job position/title
Department or division
Whether user has leadership permissions
Manager status flag
System administrator flag
Account status: 0 (enabled) or 1 (disabled)
Associated tenant ID
WeChat OpenID for WeChat login integration
User description or notes
User.java:1-173
Creating Users
Check Tenant Limits
Before creating a user, verify the tenant hasn’t reached their user limit.Reference:
UserController.java:320-325Prepare User Data
Collect required user information including login credentials and profile details.
Create User Account
Submit the user creation request:Request Body:Reference:
UserController.java:313-331Authentication
Standard Login
jshERP uses a session-based authentication system with CAPTCHA verification.Submit Login Credentials
Post login credentials with CAPTCHA:Request Body:Reference:
UserController.java:135-152WeChat Login Integration
jshERP supports WeChat authentication for mobile users:Bind WeChat Account
UserController.java:179-193
WeChat Login
UserController.java:154-177
User Management Operations
Get User Information
UserController.java:65-77
List Users
userName: Filter by display nameloginName: Filter by login name
UserController.java:79-87
Update User
UserController.java:341-349
Delete Users
UserController.java:105-119
Password Management
Change Password
Users can update their own password:The system validates the old password before allowing the change.
UserController.java:245-277
Reset Password (Admin Only)
Administrators can reset user passwords:UserController.java:230-243
User Status Management
Enable/Disable Users
Batch enable or disable user accounts:- Status
0: Enabled - Status
1: Disabled
UserController.java:540-553
Organization Integration
Get Organization User Tree
Retrieve the hierarchical organization structure with users:UserController.java:374-387
User Registration
jshERP supports self-service user registration:
Reference:
UserController.java:357-367
Session Management
Get Current User Session
UserController.java:195-213
Logout
UserController.java:215-228
User Business Permissions
Users can be assigned specific business entities (customers, warehouses, etc.) through the UserBusiness relationship:UserController.java:465-504
Tenant Information
Get User Count and Tenant Info
- Current user count
- User limit for the tenant
- Tenant type and expiration
UserController.java:560-589
Button Permissions
Users inherit button-level permissions from their roles:admin user has access to all buttons.
Reference: UserController.java:438-456
Validation
Check Login Name Uniqueness
UserController.java:121-133
Best Practices
Security Recommendations:
- Always hash passwords before transmission
- Enable CAPTCHA for login attempts
- Monitor failed login attempts
- Regularly audit user permissions
- Set strong password policies
Related Documentation
- Tenant Management - Managing tenant accounts
- Role & Permissions - Configuring user roles
- System Configuration - System-wide settings