User Management
Accessing User Administration
The admin interface is accessible at/admin/users and is managed by the AdminController:
1
Navigate to Admin Section
Access via main menu → Admin → Users
2
Search for Users
Use the search box to filter by name, ID, or username
3
Add or Edit Users
Click “Add User” or select an existing user to modify
User Model Structure
The User model (protected/models/User.php) contains:
integer
Unique user identifier
string
required
User’s first name (max 40 characters)
string
required
User’s last name (max 40 characters)
string
required
User’s email address (max 80 characters)
string
Professional title (Dr, Mr, Mrs, Ms, etc.)
boolean
default:"1"
Whether user has access to all firms/contexts
boolean
Mark user as a consultant
boolean
Mark user as a surgeon (requires additional fields)
integer
Doctor grade (required if
is_surgeon = 1)string
Professional registration code (required for surgeons)
integer
Link to contact record with full details
Creating a New User
When creating a user, the system requires:- Basic Information: Name, title, email
- Authentication: At least one institution authentication
- Roles: One or more system roles
- Context Access: Firm assignments (if
global_firm_rights = 0)
User Authentication
OpenEyes supports multiple authentication methods per user through theUserAuthentication model.
Authentication Types
- BASIC (Local)
- LDAP
- SAML
- OIDC
Local database authentication with password management.Features:
- Password complexity requirements
- Password expiration
- Account lockout after failed attempts
- Password history tracking
AUTH_SOURCE=BASIC environment variable.UserAuthentication Model
File:protected/models/UserAuthentication.php
integer
Authentication record ID
integer
required
Reference to user
integer
required
Links to institution’s authentication method
string
required
Login username (max 40 characters)
string
Hashed password (for BASIC auth only)
string
Password salt (legacy, being phased out)
string
Status:
current, expired, stale, or softlockedinteger
Failed login attempt counter
datetime
Last password change timestamp
boolean
default:"true"
Whether authentication is active
Password Management
OpenEyes automatically upgrades legacy password hashes to the modern
password_hash() method on successful login.Role-Based Access Control (RBAC)
OpenEyes uses Yii’s built-in RBAC system with three database tables:authitem- Roles, tasks, and operationsauthitemchild- Role hierarchyauthassignment- User role assignments
Default Roles
admin
System AdministratorFull access to all system features including:
- User management
- System settings
- All institutions
- Module administration
User
Standard UserBasic clinical access:
- Patient records
- Event creation
- Clinical notes
- Limited to assigned contexts
Prescribe
PrescriberPermission to prescribe medications:
- Create prescriptions
- Manage drug lists
- View medication history
Med Administer
Medication AdministratorPermission to administer medications:
- Record administration
- Document adverse reactions
Edit
EditorEnhanced editing permissions:
- Edit locked events
- Modify historical data
View clinical
Clinical ViewerView-only clinical access:
- Read patient records
- View clinical events
- No editing capabilities
Checking User Permissions
Managing User Roles
Firm/Context Management
Users can be restricted to specific firms (clinical contexts) whenglobal_firm_rights = 0.
Firm Assignments
A “firm” in OpenEyes represents a clinical service or team, typically associated with:- A subspecialty (e.g., Cataract, Glaucoma, Retina)
- A consultant or service lead
- One or more sites
PIN Code Management
OpenEyes supports PIN-based authentication for quick actions and signing:PINs can be regenerated up to 5 times within a 12-month period for security purposes (see
User.php:48).Institution-Specific Users
Non-admin users are typically restricted to their assigned institution:API Reference
User Methods
File:protected/models/User.php
getFullName()- Returns “FirstName LastName”getFullNameAndTitle()- Returns “Title FirstName LastName”getRoles()- Returns array of CAuthItem roleshasRole($targetRole)- Check if user has specific rolesaveRoles($roles)- Assign roles to usersaveFirms($firms)- Assign firms to usergetAvailableFirms()- Get firms user can accessgeneratePin($regenerate)- Generate or regenerate PIN
UserAuthentication Methods
File:protected/models/UserAuthentication.php
verifyPassword($password)- Verify password hashhandlePassword()- Process password on savesetPasswordHash()- Hash password before saveisLocalAuth()- Check if using local authentication
Security Best Practices
Strong Passwords
Configure password complexity requirements via
pw_restrictions parametersLeast Privilege
Grant users only the roles they need for their work
Regular Audits
Review user accounts and permissions regularly
Disable Inactive Users
Set
active = 0 on UserAuthentication for inactive accounts