Remove Employee from Location
1. What does this feature do? (High-Level Overview)
Section titled “1. What does this feature do? (High-Level Overview)”This feature lets an authorized operator detach an employee from the location they are working in, without deleting the underlying user account. The employee loses access to the current location only; any other locations they are assigned to remain untouched, and the user record stays in the system so they can be re-added later.
This feature is currently available.
2. Who is this for? (Roles & Permissions)
Section titled “2. Who is this for? (Roles & Permissions)”Action is gated by the delete_employees permission scoped to the current location. The permission can be granted to any location-scoped role (for example, Owner or Manager) through the role configuration in that location.
- Operator with
delete_employeesin the current location: Can preview the impact and remove an employee from that location. - Employee being removed: No action required; the user can no longer access the location once removed.
- Any other role without
delete_employees: The remove control is hidden in the list, and the underlying request is rejected.
3. Business Rules & Enforcements
Section titled “3. Business Rules & Enforcements”- Rule 1 — Location context is mandatory. The location to remove the employee from is always the active location (taken from the session, never from the form). The operation cannot target a different location than the one the operator is currently working in.
- Rule 2 — The user record is preserved. Only the link between the user and the current location is removed. The user, their global profile, and their assignments to other locations are not affected.
- Rule 3 — Self-removal is blocked. An operator cannot remove themselves from the location they are signed into. The system refuses this action.
- Rule 4 — Active patient assignments require confirmation. If the employee is still listed on one or more active patients in this location (as RBT, secondary RBT, BCBA, secondary BCBA, Clinical Director, or Case Manager), the standard removal is rejected and the system reports how many patients are affected.
- Rule 5 — “Remove anyway” clears those patient assignments. If the operator confirms the warning and chooses to proceed, the system removes the employee from those patient slots in this location only. Soft-deleted patients are ignored. Patients in other locations are not touched.
- Rule 6 — The employee must already be assigned to this location. If the user has no link to the current location, the system returns a validation error instead of silently succeeding.
- Rule 7 — All access is cleaned up atomically. When the removal succeeds, the system removes in a single transaction:
- The employee’s location assignment row.
- The employee’s location-scoped roles in this location.
- The employee’s temporary (transient) permissions scoped to this location.
- Rule 8 — Permission cache is refreshed. The employee’s cached permissions are cleared immediately so the change takes effect on their next request.
- Rule 9 — The employee is no longer visible from this location. After removal, opening the employee’s detail page within this location returns “not found”, consistent with the employee no longer belonging here.
4. UI Placement
Section titled “4. UI Placement”- Sidebar > Employees: Opens the list of employees assigned to the current location.
- Employees list — row actions: Each row shows a red Remove from this location button (trash icon) at the end of the action column. The button only appears for operators with the
delete_employeespermission. - Confirmation dialog: Opens when the button is clicked, after the system has previewed how many patients are still linked to the employee. The dialog has two variants — a simple confirmation or a warning dialog — depending on whether the employee has active patient assignments.
5. How-To Guide (Step-by-Step)
Section titled “5. How-To Guide (Step-by-Step)”Scenario A: Remove an employee with no active patient assignments
- From the sidebar, open Employees to view the location’s employee list.
- Locate the employee using the search bar or filters.
- Click the red trash icon in that row labeled Remove from this location.
- The system checks the employee for active patient assignments. Because there are none, a simple confirmation dialog appears with the employee’s name and email.
- Click Remove to confirm.
- A success notification confirms that the employee has been removed from this location, and the row disappears from the list.
Scenario B: Remove an employee who still has active patient assignments
- From the sidebar, open Employees.
- Find the employee and click the red Remove from this location trash icon.
- The system detects active patient assignments and opens a warning dialog. The dialog shows:
- The number of patients still linked to this employee in this location.
- The employee’s name and email.
- A recommendation to reassign those patients first.
- Preferred path: Click Cancel, reassign the affected patients to another provider through the patient screens, then return to the Employees list and repeat the removal.
- Override path: Click Remove anyway. The system removes the employee from the location and clears their assignments from the affected patients in this location (those patient slots become empty until a new provider is assigned).
- A success notification confirms the removal.
6. What happens if…? (Edge Cases / FAQ)
Section titled “6. What happens if…? (Edge Cases / FAQ)”- Q: Does this delete the employee’s account completely?
- A: No. The user account is preserved. Only the link to the current location is removed. The employee continues to exist in the system and remains active in any other location they are assigned to.
- Q: What happens to patients who lose their provider because of “Remove anyway”?
- A: The employee is cleared from the affected provider slots (RBT, secondary RBT, BCBA, secondary BCBA, Clinical Director, or Case Manager) for those patients in this location only. The patient is not deleted, but the slot becomes empty and should be filled by another provider as soon as possible. This is why the recommended path is to reassign first and remove afterward.
- Q: Can I remove myself from the location I am working in?
- A: No. The system blocks self-removal. If you need to leave a location, another operator with
delete_employeesmust perform the action.
- A: No. The system blocks self-removal. If you need to leave a location, another operator with
- Q: If the employee is later re-added to this location, do they get their previous roles and permissions back?
- A: No. The location-scoped roles and temporary permissions for this location are removed as part of the cleanup. When re-added, the employee starts fresh and roles must be assigned again.