User Management
Accessing User Administration
The admin interface is accessible at/admin/users and is managed by the AdminController:
User Model Structure
The User model (protected/models/User.php) contains:
Unique user identifier
User’s first name (max 40 characters)
User’s last name (max 40 characters)
User’s email address (max 80 characters)
Professional title (Dr, Mr, Mrs, Ms, etc.)
Whether user has access to all firms/contexts
Mark user as a consultant
Mark user as a surgeon (requires additional fields)
Doctor grade (required if
is_surgeon = 1)Professional registration code (required for surgeons)
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
Authentication record ID
Reference to user
Links to institution’s authentication method
Login username (max 40 characters)
Hashed password (for BASIC auth only)
Password salt (legacy, being phased out)
Status:
current, expired, stale, or softlockedFailed login attempt counter
Last password change timestamp
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