Employee Auto Provisioning
Employee Auto-Provisioning (HRMS → LMS)
When HR creates an Employee record in Smooth HR, Smooth LMS automatically ensures the linked User can access the learning portal. This happens through a server-side hook—on_employee_created in lms.lms.hrms_integration—registered on the Employee record after_insert event. No manual role assignment, or IT ticket is required for standard hires.
Auto-provisioning is the first integration touchpoint in the hire-to-learn journey. It runs before onboarding mandatory enrollment (Onboarding Mandatory Training) and before HR assigns ad-hoc courses (Assign Training From Hr). Understanding this step prevents the most common support issue: "My new hire cannot log in to /lms."
Help URL: Employee Auto Provisioning
Prerequisite HR guides: People Overview, User Roles & Permissions
Table of Contents
- What happens automatically
- Prerequisites on the HR side
- The LMS Student role
- Hook behavior step by step
- Employee creation paths in HR
- Desk verification checklist
- Bulk imports and migrations
- Security and permissions
- Troubleshooting
- Related guides
What happens automatically
On Employee after_insert:
- Smooth LMS reads
doc.user_idon the new Employee. - If
user_idis empty, the hook exits silently—no error is shown to HR. - If a User exists, LMS checks whether LMS Student is already in
user.roles. - If missing, LMS appends the role and saves the User with
ignore_permissions=True.
The employee can then sign in and see courses at /lms (subject to enrollments). Auto-provisioning does not enroll courses by itself—that occurs when Employee Onboarding is created (Onboarding Mandatory Training) or when HR/moderators assign training.
This design keeps HR workflows simple: create Employee with User ID, and LMS access follows. Refer to the integration overview at Overview for the full capability map alongside Documents & Compliance and Onboarding.
Prerequisites on the HR side
| Requirement | Why it matters | HR guide |
|---|---|---|
| User ID populated on Employee | Hook target | People |
| User account enabled | Login works | Roles |
| Employee linked before onboarding training | Enrollment uses employee.user_id |
Employee Onboarding |
| Email unique on User | LMS identifies member by email |
Standard account rules |
Creating User + Employee together
Typical flow from Employee Onboarding:
- Recruiting completes in Recruitment.
- HR submits onboarding from a Template.
- HR clicks Create Employee (or equivalent) when ready.
- Smooth HR creates/links the user account and Employee with matching email.
- LMS hook grants LMS Student immediately on insert.
If HR creates Employee records manually from /app/employee/new-employee, ensure User ID is set in the same session—do not save an Employee "to fill in later" if you expect same-day LMS access.
The LMS Student role
LMS Student is the baseline learner role in Smooth LMS:
| Capability | LMS Student | Notes |
|---|---|---|
Access /lms portal |
Yes | After login |
| View enrolled courses | Yes | Via LMS Enrollment |
| View own assignments | Yes | LMS Training Assignment (owner read) |
| Create courses | No | Requires Moderator |
| Assign training to others | No | Requires Moderator or API role |
| HR compliance records | No | Separate HR roles |
HR staff who also take training should have both HR roles and LMS Student. HR Manager alone does not grant LMS portal course access unless configured separately.
Cross-reference User Roles & Permissions when auditing role overlap between HR and L&D teams.
Hook behavior step by step
Source reference (lms.lms.hrms_integration.on_employee_created):
Employee after_insert
→ if not doc.user_id: return
→ load User(doc.user_id)
→ if LMS Student not in roles:
append role LMS Student
save User (ignore_permissions)
Idempotent: Re-saving Employee does not re-trigger after_insert. If provisioning failed silently (no user_id), fixing User ID and creating a new Employee is wrong—instead add LMS Student manually once, or use a one-off script.
Not triggered on update: Promotions, department changes, or manager updates on existing Employee do not re-run provisioning. Existing users retain LMS Student.
Employee creation paths in HR
| Path | When used | LMS impact |
|---|---|---|
| Manual Employee form | Rehire, acquisition, intern | Hook on insert if user_id set |
| From Job Offer / Applicant | Standard hire | User often created during offer acceptance |
| Employee Onboarding → Create Employee | Onboarding workflow | Preferred; aligns with portal |
| Data import | Migration | Hook runs per row if insert; bulk fix may be needed |
For contractors vs employees, decide policy: if contractors need training but not full HR records, you may create simplified Employee rows or standalone Users—document your rule so compliance and LMS stay aligned.
Desk verification checklist
After creating a test Employee:
- Open User from Employee → User ID link.
- Scroll to Roles table → confirm LMS Student present.
- Log in as that user → navigate to
/lms. - Confirm portal loads (empty catalog is OK before enrollment).
- Create Employee Onboarding → verify mandatory enrollments per Onboarding Mandatory Training.
- Optionally assign a non-mandatory course via Assign Training From Hr.
For admins, LMS Settings (Lms Settings General) controls whether Show Employees appears in batch sidebars—useful when HR and L&D co-manage cohorts.
Bulk imports and migrations
Importing thousands of Employees via Data Import Tool:
Include user_id column or map email → User creation first.
after_insertfires per record—expect slower imports; run off-hours.Employees imported with
ignore_linksmay skip Users—audit with:Userlist filtered by users missing LMS Student but linked on Employee.Historical hires already active: ask Smooth support to grant LMS Student access to existing employees who already have a linked login.
Migrated users from a legacy LMS still need Smooth LMS LMS Enrollment rows—provisioning only handles roles, not content migration.
Security and permissions
The hook uses ignore_permissions=True because HR Users creating Employees typically cannot edit arbitrary User roles. Only the LMS Student role is appended—never Moderator or System Manager.
Review role separation policies:
- HR should not self-assign Moderator without L&D approval.
- Terminated employees: disable User enabled flag in HR offboarding (Tenure)—LMS access stops at login, but enrollments remain for records.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| No LMS Student role | Empty user_id on Employee | Set User ID; add role manually if insert already passed |
| User cannot login | User disabled / no password | Reset password; check enabled |
| Role present but /lms 403 | Missing website permissions / LMS not installed | Verify lms app on site |
| Duplicate users | Email mismatch Applicant vs Employee | Align emails before Create Employee |
| Hook never ran | Employee created before LMS app install | Backfill roles via report |
Related guides
- HRMS + LMS Integration Overview
- Onboarding Mandatory Training
- Assign Training from HR
- People Overview
- Employee Onboarding
- Onboarding Portal
- User Roles & Permissions
- Recruitment Overview
- LMS Settings — General
Last updated: May 2026
Day-in-the-life examples
Example 1 — Standard full-time hire
Acme Corp completes recruitment for a warehouse associate. HR submits Employee Onboarding from a template that includes I-9 upload tasks. When HR clicks Create Employee, Frappe creates User associate@acme.com and Employee HR-EMP-0042 with matching User ID. Within the same request, LMS appends LMS Student. The associate receives portal links for onboarding paperwork and /lms training. No L&D moderator touches role tables manually.
Example 2 — Rehire with existing User
A former employee returns; HR reactivates User instead of creating duplicate. New Employee insert still fires the hook—but role already present, so save is skipped. L&D assigns refresher courses via Assign Training from HR rather than relying on onboarding mandatory set.
Example 3 — Migration gap
Legacy HRIS import creates 500 Employees without user_id. Hook never ran. HR runs audit script, creates Users in batch, sets user_id, manually adds LMS Student—or re-insert is impossible; use data fix. Plan migration checkpoints with Getting Started staging site.
Governance checklist for HRIS admins
| Control | Owner | Frequency |
|---|---|---|
| Active Employee has user_id | HR Operations | Monthly |
| Active Employee User has LMS Student | L&D admin | Monthly |
| Terminated User disabled | HR Offboarding | Per event |
| Role change to Moderator documented | IT Security | Per change |
| SSO email matches Employee company email | IT + HR | Per hire |
Publish checklist alongside Documents & Compliance audit calendar so learning access reviews coincide with compliance attestations.
FAQ
Does updating Department re-provision LMS? No. Only after_insert on Employee.
Can we remove LMS Student on promotion to manager? Yes manually, but managers often still take training—keep role unless policy forbids learner UI.
Does Applicant User get LMS Student before Employee exists? Not via this hook. Applicants are not employees; training starts post-hire.
What about employees without email? Rare; Frappe User requires email—align with People standards.
Smooth HR (HRMS)
| Guide | Link |
|---|---|
| HR help home | smoothhiring.com/help/hrms |
| Employee records | hrms/people/employee-records |
| Onboarding overview | hrms/onboarding/overview |
| Onboarding templates | hrms/onboarding/onboarding-templates |
| Employee onboarding | hrms/onboarding/employee-onboarding |
| Documents & compliance | hrms/documents-compliance/overview |
| Employee compliance | hrms/documents-compliance/employee-compliance |
| Signature templates | hrms/documents-compliance/signature-templates |