3 * This program is run by the OpenEMR setup.php script to install phpGACL
4 * and creates the Access Control Objects and their sections.
5 * See openemr/library/acl.inc file for the list of
6 * currently supported Access Control Objects(ACO), which this
7 * script will install. This script also creates several
8 * ARO groups, an "admin" ARO, and some reasonable ACL entries for
12 * Physicians (Doctors)
13 * Clinicians (Nurses, Physician Assistants, etc.)
14 * Front Office (Receptionist)
18 * When upgrading to a new version of OpenEMR, run the acl_upgrade.php
19 * script to update the phpGACL access controls. This is required to
20 * ensure the database includes all the required Access Control
24 * @link http://www.open-emr.org
25 * @author Rod Roark <rod@sunsetsystems.com>
26 * @author Brady Miller <brady.g.miller@gmail.com>
27 * @copyright Copyright (c) 2005-2017 Rod Roark <rod@sunsetsystems.com>
28 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
29 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
32 require_once(dirname(__FILE__
).'/library/acl.inc');
34 if (empty($phpgacl_location)) {
35 die("You must first set up library/acl.inc to use phpGACL!");
38 require_once("$phpgacl_location/gacl_api.class.php");
40 $gacl = new gacl_api();
42 // Create the ACO sections. Every ACO must have a section.
44 if ($gacl->add_object_section('Accounting', 'acct', 10, 0, 'ACO') === false) {
45 echo "Unable to create the access controls for OpenEMR. You have likely already run this script (acl_setup.php) successfully.<br>Other possible problems include php-GACL configuration file errors (gacl.ini.php or gacl.class.php).<br>";
49 $gacl->add_object_section('Administration', 'admin', 10, 0, 'ACO');
50 // xl('Administration')
51 $gacl->add_object_section('Encounters', 'encounters', 10, 0, 'ACO');
53 $gacl->add_object_section('Lists', 'lists', 10, 0, 'ACO');
55 $gacl->add_object_section('Patients', 'patients', 10, 0, 'ACO');
57 $gacl->add_object_section('Squads', 'squads', 10, 0, 'ACO');
59 $gacl->add_object_section('Sensitivities', 'sensitivities', 10, 0, 'ACO');
60 // xl('Sensitivities')
61 $gacl->add_object_section('Placeholder', 'placeholder', 10, 0, 'ACO');
63 $gacl->add_object_section('Nation Notes', 'nationnotes', 10, 0, 'ACO');
65 $gacl->add_object_section('Patient Portal', 'patientportal', 10, 0, 'ACO');
66 // xl('Patient Portal')
67 $gacl->add_object_section('Menus', 'menus', 10, 0, 'ACO');
69 $gacl->add_object_section('Groups', 'groups', 10, 0, 'ACO');
74 // Create Accounting ACOs.
76 $gacl->add_object('acct', 'Billing (write optional)', 'bill', 10, 0, 'ACO');
77 // xl('Billing (write optional)')
78 $gacl->add_object('acct', 'Price Discounting', 'disc', 10, 0, 'ACO');
79 // xl('Price Discounting')
80 $gacl->add_object('acct', 'EOB Data Entry', 'eob', 10, 0, 'ACO');
81 // xl('EOB Data Entry')
82 $gacl->add_object('acct', 'Financial Reporting - my encounters', 'rep', 10, 0, 'ACO');
83 // xl('Financial Reporting - my encounters')
84 $gacl->add_object('acct', 'Financial Reporting - anything', 'rep_a', 10, 0, 'ACO');
85 // xl('Financial Reporting - anything')
87 // Create Administration ACOs.
89 $gacl->add_object('admin', 'Superuser', 'super', 10, 0, 'ACO');
91 $gacl->add_object('admin', 'Calendar Settings', 'calendar', 10, 0, 'ACO');
92 // xl('Calendar Settings')
93 $gacl->add_object('admin', 'Database Reporting', 'database', 10, 0, 'ACO');
94 // xl('Database Reporting')
95 $gacl->add_object('admin', 'Forms Administration', 'forms', 10, 0, 'ACO');
96 // xl('Forms Administration')
97 $gacl->add_object('admin', 'Practice Settings', 'practice', 10, 0, 'ACO');
98 // xl('Practice Settings')
99 $gacl->add_object('admin', 'Superbill Codes Administration', 'superbill', 10, 0, 'ACO');
100 // xl('Superbill Codes Administration')
101 $gacl->add_object('admin', 'Users/Groups/Logs Administration', 'users', 10, 0, 'ACO');
102 // xl('Users/Groups/Logs Administration')
103 $gacl->add_object('admin', 'Batch Communication Tool', 'batchcom', 10, 0, 'ACO');
104 // xl('Batch Communication Tool')
105 $gacl->add_object('admin', 'Language Interface Tool', 'language', 10, 0, 'ACO');
106 // xl('Language Interface Tool')
107 $gacl->add_object('admin', 'Pharmacy Dispensary', 'drugs', 10, 0, 'ACO');
108 // xl('Pharmacy Dispensary')
109 $gacl->add_object('admin', 'ACL Administration', 'acl', 10, 0, 'ACO');
110 // xl('ACL Administration')
111 $gacl->add_object('admin', 'Multipledb', 'multipledb', 10, 0, 'ACO');
113 $gacl->add_object('admin', 'Menu', 'menu', 10, 0, 'ACO');
116 // Create ACOs for encounters.
118 $gacl->add_object('encounters', 'Authorize - my encounters', 'auth', 10, 0, 'ACO');
119 // xl('Authorize - my encounters')
120 $gacl->add_object('encounters', 'Authorize - any encounters', 'auth_a', 10, 0, 'ACO');
121 // xl('Authorize - any encounters')
122 $gacl->add_object('encounters', 'Coding - my encounters (write,wsome optional)', 'coding', 10, 0, 'ACO');
123 // xl('Coding - my encounters (write,wsome optional)')
124 $gacl->add_object('encounters', 'Coding - any encounters (write,wsome optional)', 'coding_a', 10, 0, 'ACO');
125 // xl('Coding - any encounters (write,wsome optional)')
126 $gacl->add_object('encounters', 'Notes - my encounters (write,addonly optional)', 'notes', 10, 0, 'ACO');
127 // xl('Notes - my encounters (write,addonly optional)')
128 $gacl->add_object('encounters', 'Notes - any encounters (write,addonly optional)', 'notes_a', 10, 0, 'ACO');
129 // xl('Notes - any encounters (write,addonly optional)')
130 $gacl->add_object('encounters', 'Fix encounter dates - any encounters', 'date_a', 10, 0, 'ACO');
131 // xl('Fix encounter dates - any encounters')
132 $gacl->add_object('encounters', 'Less-private information (write,addonly optional)', 'relaxed', 10, 0, 'ACO');
133 // xl('Less-private information (write,addonly optional)')
135 // Create ACOs for lists.
137 $gacl->add_object('lists', 'Default List (write,addonly optional)', 'default', 10, 0, 'ACO');
138 // xl('Default List (write,addonly optional)')
139 $gacl->add_object('lists', 'State List (write,addonly optional)', 'state', 10, 0, 'ACO');
140 // xl('State List (write,addonly optional)')
141 $gacl->add_object('lists', 'Country List (write,addonly optional)', 'country', 10, 0, 'ACO');
142 // xl('Country List (write,addonly optional)')
143 $gacl->add_object('lists', 'Language List (write,addonly optional)', 'language', 10, 0, 'ACO');
144 // xl('Language List (write,addonly optional)')
145 $gacl->add_object('lists', 'Ethnicity-Race List (write,addonly optional)', 'ethrace', 10, 0, 'ACO');
146 // xl('Ethnicity-Race List (write,addonly optional)')
148 // Create ACOs for patientportal.
150 $gacl->add_object('patientportal', 'Patient Portal', 'portal', 10, 0, 'ACO');
151 // xl('Patient Portal')
153 // Create ACOs for modules.
155 $gacl->add_object('menus', 'Modules', 'modle', 10, 0, 'ACO');
158 // Create ACOs for patients.
160 $gacl->add_object('patients', 'Appointments (write,wsome optional)', 'appt', 10, 0, 'ACO');
161 // xl('Appointments (write,wsome optional)')
162 $gacl->add_object('patients', 'Demographics (write,addonly optional)', 'demo', 10, 0, 'ACO');
163 // xl('Demographics (write,addonly optional)')
164 $gacl->add_object('patients', 'Medical/History (write,addonly optional)', 'med', 10, 0, 'ACO');
165 // xl('Medical/History (write,addonly optional)')
166 $gacl->add_object('patients', 'Transactions (write optional)', 'trans', 10, 0, 'ACO');
167 // xl('Transactions (write optional)')
168 $gacl->add_object('patients', 'Documents (write,addonly optional)', 'docs', 10, 0, 'ACO');
169 // xl('Documents (write,addonly optional)')
170 $gacl->add_object('patients', 'Patient Notes (write,addonly optional)', 'notes', 10, 0, 'ACO');
171 // xl('Patient Notes (write,addonly optional)')
172 $gacl->add_object('patients', 'Sign Lab Results (write,addonly optional)', 'sign', 10, 0, 'ACO');
173 // xl('Sign Lab Results (write,addonly optional)')
174 $gacl->add_object('patients', 'Patient Reminders (write,addonly optional)', 'reminder', 10, 0, 'ACO');
175 // xl('Patient Reminders (write,addonly optional)')
176 $gacl->add_object('patients', 'Clinical Reminders/Alerts (write,addonly optional)', 'alert', 10, 0, 'ACO');
177 // xl('Clinical Reminders/Alerts (write,addonly optional)')
178 $gacl->add_object('patients', 'Disclosures (write,addonly optional)', 'disclosure', 10, 0, 'ACO');
179 // xl('Disclosures (write,addonly optional)')
180 $gacl->add_object('patients', 'Prescriptions (write,addonly optional)', 'rx', 10, 0, 'ACO');
181 // xl('Prescriptions (write,addonly optional)')
182 $gacl->add_object('patients', 'Amendments (write,addonly optional)', 'amendment', 10, 0, 'ACO');
183 // xl('Amendments (write,addonly optional)')
184 $gacl->add_object('patients', 'Lab Results (write,addonly optional)', 'lab', 10, 0, 'ACO');
185 // xl('Lab Results (write,addonly optional)')
188 $gacl->add_object('groups', 'View/Add/Update groups', 'gadd', 10, 0, 'ACO');
189 // xl('View/Add/Update groups')
190 $gacl->add_object('groups', 'View/Create/Update groups appointment in calendar', 'gcalendar', 10, 0, 'ACO');
191 // xl('View/Create/Update groups appointment in calendar')
192 $gacl->add_object('groups', 'Group encounter log', 'glog', 10, 0, 'ACO');
193 // xl('Group encounter log')
194 $gacl->add_object('groups', 'Group detailed log of appointment in patient record', 'gdlog', 10, 0, 'ACO');
195 // xl('Group detailed log of appointment in patient record')
196 $gacl->add_object('groups', 'Send message from the permanent group therapist to the personal therapist', 'gm', 10, 0, 'ACO');
197 // xl('Send message from the permanent group therapist to the personal therapist')
199 // Create ACOs for sensitivities.
201 $gacl->add_object('sensitivities', 'Normal', 'normal', 10, 0, 'ACO');
203 $gacl->add_object('sensitivities', 'High', 'high', 20, 0, 'ACO');
206 // Create ACO for placeholder.
208 $gacl->add_object('placeholder', 'Placeholder (Maintains empty ACLs)', 'filler', 10, 0, 'ACO');
209 // xl('Placeholder (Maintains empty ACLs)')
211 // Create ACO for nationnotes.
213 $gacl->add_object('nationnotes', 'Nation Notes Configure', 'nn_configure', 10, 0, 'ACO');
214 // xl('Nation Notes Configure')
216 // Create ARO groups.
218 $users = $gacl->add_group('users', 'OpenEMR Users', 0, 'ARO');
219 // xl('OpenEMR Users')
220 $admin = $gacl->add_group('admin', 'Administrators', $users, 'ARO');
221 // xl('Administrators')
222 $clin = $gacl->add_group('clin', 'Clinicians', $users, 'ARO');
224 $doc = $gacl->add_group('doc', 'Physicians', $users, 'ARO');
226 $front = $gacl->add_group('front', 'Front Office', $users, 'ARO');
227 // xl('Front Office')
228 $back = $gacl->add_group('back', 'Accounting', $users, 'ARO');
230 $breakglass = $gacl->add_group('breakglass', 'Emergency Login', $users, 'ARO');
231 // xl('Emergency Login')
234 // Create a Users section for the AROs (humans).
236 $gacl->add_object_section('Users', 'users', 10, 0, 'ARO');
239 // Create the Administrator in the above-created "users" section
240 // and add him/her to the above-created "admin" group.
241 // If this script is being used by OpenEMR's setup, then will
242 // incorporate the installation values. Otherwise will
243 // hardcode the 'admin' user.
244 if (isset($this) && isset($this->iuser
)) {
245 $gacl->add_object('users', $this->iuname
, $this->iuser
, 10, 0, 'ARO');
246 $gacl->add_group_object($admin, 'users', $this->iuser
, 'ARO');
248 $gacl->add_object('users', 'Administrator', 'admin', 10, 0, 'ARO');
249 $gacl->add_group_object($admin, 'users', 'admin', 'ARO');
252 // Declare return terms for language translations
253 // xl('write') xl('wsome') xl('addonly') xl('view')
255 // Set permissions for administrators.
259 'acct'=>array('bill', 'disc', 'eob', 'rep', 'rep_a'),
260 'admin'=>array('calendar', 'database', 'forms', 'practice', 'superbill', 'users', 'batchcom', 'language', 'super', 'drugs', 'acl','multipledb','menu'),
261 'encounters'=>array('auth_a', 'auth', 'coding_a', 'coding', 'notes_a', 'notes', 'date_a', 'relaxed'),
262 'lists'=>array('default','state','country','language','ethrace'),
263 'patients'=>array('appt', 'demo', 'med', 'trans', 'docs', 'notes', 'sign', 'reminder', 'alert', 'disclosure', 'rx', 'amendment', 'lab'),
264 'sensitivities'=>array('normal', 'high'),
265 'nationnotes'=>array('nn_configure'),
266 'patientportal'=>array('portal'),
267 'menus'=>array('modle'),
268 'groups'=>array('gadd','gcalendar','glog','gdlog','gm')
277 'Administrators can do anything'
279 // xl('Administrators can do anything')
281 // Set permissions for physicians.
285 'placeholder'=>array('filler')
294 'Things that physicians can only read'
296 // xl('Things that physicians can only read')
299 'placeholder'=>array('filler')
308 'Things that physicians can read and enter but not modify'
310 // xl('Things that physicians can read and enter but not modify')
313 'placeholder'=>array('filler')
322 'Things that physicians can read and partly modify'
324 // xl('Things that physicians can read and partly modify')
327 'acct'=>array('disc', 'rep'),
328 'admin'=>array('drugs'),
329 'encounters'=>array('auth_a', 'auth', 'coding_a', 'coding', 'notes_a', 'notes', 'date_a', 'relaxed'),
330 'patients' => array('appt', 'demo', 'med', 'trans', 'docs', 'notes', 'sign', 'reminder', 'alert',
331 'disclosure', 'rx', 'amendment', 'lab'),
332 'sensitivities'=>array('normal', 'high'),
333 'groups'=>array('gcalendar','glog')
342 'Things that physicians can read and modify'
344 // xl('Things that physicians can read and modify')
346 // Set permissions for clinicians.
350 'placeholder'=>array('filler')
359 'Things that clinicians can only read'
361 // xl('Things that clinicians can only read')
364 'encounters'=>array('notes', 'relaxed'),
365 'patients'=>array('demo', 'med', 'docs', 'notes','trans', 'reminder', 'alert', 'disclosure', 'rx', 'amendment', 'lab'),
366 'sensitivities'=>array('normal')
375 'Things that clinicians can read and enter but not modify'
377 // xl('Things that clinicians can read and enter but not modify')
380 'placeholder'=>array('filler')
389 'Things that clinicians can read and partly modify'
391 // xl('Things that clinicians can read and partly modify')
394 'admin'=>array('drugs'),
395 'encounters'=>array('coding'),
396 'patients'=>array('appt'),
397 'groups'=>array('gcalendar','glog')
406 'Things that clinicians can read and modify'
408 // xl('Things that clinicians can read and modify')
410 // Set permissions for front office staff.
414 'patients'=>array('alert')
423 'Things that front office can only read'
425 // xl('Things that front office can only read')
428 'placeholder'=>array('filler')
437 'Things that front office can read and enter but not modify'
439 // xl('Things that front office can read and enter but not modify')
442 'placeholder'=>array('filler')
451 'Things that front office can read and partly modify'
453 // xl('Things that front office can read and partly modify')
456 'patients'=>array('appt', 'demo', 'trans', 'notes'),
457 'groups'=>array('gcalendar')
466 'Things that front office can read and modify'
468 // xl('Things that front office can read and modify')
470 // Set permissions for back office staff.
474 'patients'=>array('alert')
483 'Things that back office can only read'
485 // xl('Things that back office can only read')
488 'placeholder'=>array('filler')
497 'Things that back office can read and enter but not modify'
499 // xl('Things that back office can read and enter but not modify')
502 'placeholder'=>array('filler')
511 'Things that back office can read and partly modify'
513 // xl('Things that back office can read and partly modify')
516 'acct'=>array('bill', 'disc', 'eob', 'rep', 'rep_a'),
517 'admin'=>array('practice', 'superbill'),
518 'encounters'=>array('auth_a', 'coding_a', 'date_a'),
519 'patients'=>array('appt', 'demo')
528 'Things that back office can read and modify'
530 // xl('Things that back office can read and modify')
532 // Set permissions for Emergency Login.
536 'acct'=>array('bill', 'disc', 'eob', 'rep', 'rep_a'),
537 'admin'=>array('calendar', 'database', 'forms', 'practice', 'superbill', 'users', 'batchcom', 'language', 'super', 'drugs', 'acl','multipledb','menu'),
538 'encounters'=>array('auth_a', 'auth', 'coding_a', 'coding', 'notes_a', 'notes', 'date_a', 'relaxed'),
539 'lists'=>array('default','state','country','language','ethrace'),
540 'patients'=>array('appt', 'demo', 'med', 'trans', 'docs', 'notes', 'sign', 'reminder', 'alert', 'disclosure', 'rx', 'amendment', 'lab'),
541 'sensitivities'=>array('normal', 'high'),
542 'nationnotes'=>array('nn_configure'),
543 'patientportal'=>array('portal'),
544 'menus'=>array('modle'),
545 'groups'=>array('gadd','gcalendar','glog','gdlog','gm')
554 'Emergency Login user can do anything'
556 // xl('Emergency Login user can do anything')
561 <title
>OpenEMR ACL Setup
</title
>
562 <link rel
=STYLESHEET href
="interface/themes/style_blue.css">
565 <b
>OpenEMR ACL Setup
</b
>
567 All done configuring
and installing access
controls (php
-GACL
)!