User Management
Directors create and manage all staff accounts for their clinic — assigning roles, updating credentials, and keeping the team roster organised from a single dashboard.
Overview
The User Management module gives Directors a front-end dashboard to create, view, edit, and delete the staff accounts that belong to their clinic. Every user created here is automatically linked to the creating Director, so each clinic's team stays completely separate from other clinics on the same platform.
Create users
Set username, email, name, password, and one or more roles in a single form. The account is active immediately.
Inline edit
An edit form expands inline below each user's table row — no page navigation required. Update email, name, password, and roles.
Delete users
Permanently removes the WordPress user account after a confirmation prompt. Cannot be undone.
Live search
Filter the user table instantly by typing — searches across username, name, email, and role columns simultaneously.
Access
The dashboard is restricted to users with the clinic_director role. Non-directors visiting the page see "Access denied." All AJAX endpoints (create, update, delete, get users, get user) additionally verify the manage_clinic_users capability before executing.
The manage_clinic_users capability is granted only to the clinic_director role. Other roles have only the basic read capability and cannot access any of the management actions.
Available Roles
When creating or editing a user, the Director selects one or more roles from a checkbox list. The roles available to assign are:
Veterinarian
Clinical staff. Can admit, edit, and discharge indoor patients; issue certificates; access the indoor dashboard.
Para Vet
Support clinical staff. Can admit and view indoor patients assigned to them; access the Para Vet task board.
Lab Technician
Laboratory staff role. Assigned via this system; access permissions depend on other installed modules.
Receptionist
Front desk staff. Can admit and view indoor patients; no edit, delete, discharge, or indoor dashboard access.
Pet Owner
Client-facing role. Pet owners are excluded from messaging recipient lists and certificate issuing. Access to client-facing features only.
The Director role itself is not in the assignable list — you cannot create another Director from this dashboard. Directors are set up at the platform level. Each of the roles above is registered as a WordPress custom role with only the read capability by default; their feature access is controlled by individual plugin checks.
Assigning Multiple Roles
Both the Create and Edit forms support assigning more than one role to a single user. Simply check multiple role checkboxes. On save, the system clears all existing roles from the account and re-assigns every checked role — so the saved state always exactly matches what you selected.
A user with both Veterinarian and Receptionist roles will have the combined access of both — for example, they could both see the indoor dashboard (Vet capability) and perform front-desk tasks (Receptionist capability).
At least one role must be selected. Submitting with no roles checked will show an error and the form will not submit.
Dashboard Overview
The dashboard has two main areas:
- Header bar — shows the Director's display name, the current total user count, and the + Add New User button.
- Users table — lists all users in your clinic with columns for Username, Name, Email, Roles, and Actions. The role(s) of each user are shown as small badges.
The user list loads automatically when the page opens. The total count in the header updates live each time the list reloads (after a create, update, or delete).
Table Columns
| Column | Content |
|---|---|
| Username | The user's WordPress login name. Cannot be changed after creation. |
| Name | First name + last name. Falls back to username if both are blank. |
| The user's email address. | |
| Roles | One badge per assigned role, showing the display name (e.g. "Veterinarian", "Para Vet"). |
| Actions | Edit button (opens inline edit form) and Delete button (with confirmation). |
Create a User
Click "+ Add New User"
The create form slides down below the header. Any open inline edit form closes automatically.
Fill in the fields
Username (required), Email (required), First Name, Last Name, and Password (required). Username and email must not already exist on the platform.
Select at least one role
Check one or more role checkboxes. The form cannot be submitted without a role selected.
Click "Create User"
On success: a green message appears, the form resets and slides up, and the user table reloads with the new user. The new account has clinic_director_id set to your user ID, linking it to your clinic.
Create Form Fields
| Field | Required? | Notes |
|---|---|---|
| Username | Required | Must be unique across the entire platform. Cannot be changed after creation. |
| Required | Must be unique across the platform. | |
| First Name | Optional | Stored in WordPress user meta. |
| Last Name | Optional | Stored in WordPress user meta. |
| Password | Required | Set at creation. Can be changed later via Edit. Share with the user securely. |
| Roles | Required | At least one checkbox must be ticked. |
Usernames and emails must be unique across the whole WordPress installation, not just your clinic. If another clinic's user or a platform admin already has the same username or email, creation will fail with "Username exists" or "Email exists".
Edit a User
Click the Edit button in a user's row. An inline edit form expands directly below that row in the table — no modal, no page navigation. The form is pre-filled with the user's current email, first name, last name, and roles (checkboxes pre-checked).
Editable Fields
| Field | Notes |
|---|---|
| Can be changed to any email that isn't already in use on the platform. | |
| First Name | Optional. |
| Last Name | Optional. |
| New Password | Leave blank to keep the existing password unchanged. Enter a new value to reset it. |
| Roles | Check/uncheck as needed. At least one must remain checked. The full set of roles is replaced on save — all previous roles are cleared first, then the checked roles are applied. |
Username cannot be changed. The inline edit form shows the username as a read-only heading ("✏ Editing: [username]") but does not include a username field — WordPress usernames are permanent once created.
Click Update User to save. A success message appears, the inline form closes, and the table reloads. Click Cancel or click the same Edit button again to close the form without saving.
Only one inline edit form can be open at a time. Opening a second user's edit form automatically closes the first.
Delete a User
Click the Delete button in a user's row. A browser confirmation dialog appears: "Delete this user?" Click OK to proceed or Cancel to abort.
On confirmation, the user account is permanently deleted from WordPress (wp_delete_user()). The table reloads and the user count updates.
Deletion is permanent and cannot be undone. The WordPress user account and all associated user meta (including the clinic_director_id link) are removed. Any case records, messages, or certificates created by this user will retain their data in the database, but the user account itself is gone.
You can only delete users who belong to your clinic — i.e. users whose clinic_director_id matches your user ID. Attempting to delete a user from another clinic returns "Not your user" and the deletion is blocked.
Search Users
The search box above the user table filters rows in real time as you type. It searches across all visible text in the row — username, full name, email, and role badges — simultaneously. The filter is case-insensitive.
The search is client-side: it shows and hides existing table rows rather than querying the server. This means it only searches users that are currently loaded. If you have just created a user, the table will reload automatically and the new user will be included in subsequent searches.
The inline edit row (if open) is excluded from search filtering — it will stay visible regardless of what you type in the search box.
Clinic Scoping
Every user created through this dashboard has the clinic_director_id user meta field set to the creating Director's WordPress user ID. This is the mechanism that ties a staff member to a specific clinic.
When the dashboard loads the user list, it fetches all WordPress users where clinic_director_id = [current director's ID]. This means:
- Directors on the same platform cannot see each other's staff
- A user can only be edited or deleted by the Director they were created under
- Other modules (Indoor Patients, Certificates, Messaging, etc.) use the same
clinic_director_idmeta to scope their data
If a staff user's clinic_director_id meta is missing or incorrect, they will not appear in this dashboard and will not be correctly scoped in other modules (e.g. they won't appear in the indoor patient vet selector or the messaging recipient list). Always use this dashboard to create staff accounts rather than the WordPress admin panel.
FAQ
No. WordPress usernames are permanent. The edit form does not include a username field. If a username needs to change, you would need to delete the old account and create a new one with the correct username.
The data records themselves (indoor patient cases, certificates, etc.) remain in the database — they are not deleted along with the user. However, the user account is permanently gone, so the person will lose portal access and their name may show as "Unknown" or by ID in some displays.
No. The clinic_director role is not in the assignable role list. Directors must be set up at the platform/admin level. This dashboard only manages staff roles.
Other modules fetch vets using both the clinic_veterinarian role and the clinic_director_id meta. If you created the user through this dashboard they will have the correct meta. If the user still doesn't appear, check that you selected the Veterinarian role when creating or editing them.
Yes. You can check multiple roles. The user will then have the combined access of all assigned roles across the clinic modules.
No. The user list is always filtered to clinic_director_id = [your ID]. You will never see users belonging to a different Director, and the edit/delete endpoints reject requests for users that don't belong to you.
The password is left unchanged. The update only sets a new password if the password field contains a non-empty value.
Clear the search box by deleting what you typed. The filter is live and removing the search term immediately restores all rows.