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');
115 $gacl->add_object('admin', 'Manage modules', 'manage_modules', 10, 0, 'ACO');
116 // xl('Manage modules')
119 // Create ACOs for encounters.
121 $gacl->add_object('encounters', 'Authorize - my encounters', 'auth', 10, 0, 'ACO');
122 // xl('Authorize - my encounters')
123 $gacl->add_object('encounters', 'Authorize - any encounters', 'auth_a', 10, 0, 'ACO');
124 // xl('Authorize - any encounters')
125 $gacl->add_object('encounters', 'Coding - my encounters (write,wsome optional)', 'coding', 10, 0, 'ACO');
126 // xl('Coding - my encounters (write,wsome optional)')
127 $gacl->add_object('encounters', 'Coding - any encounters (write,wsome optional)', 'coding_a', 10, 0, 'ACO');
128 // xl('Coding - any encounters (write,wsome optional)')
129 $gacl->add_object('encounters', 'Notes - my encounters (write,addonly optional)', 'notes', 10, 0, 'ACO');
130 // xl('Notes - my encounters (write,addonly optional)')
131 $gacl->add_object('encounters', 'Notes - any encounters (write,addonly optional)', 'notes_a', 10, 0, 'ACO');
132 // xl('Notes - any encounters (write,addonly optional)')
133 $gacl->add_object('encounters', 'Fix encounter dates - any encounters', 'date_a', 10, 0, 'ACO');
134 // xl('Fix encounter dates - any encounters')
135 $gacl->add_object('encounters', 'Less-private information (write,addonly optional)', 'relaxed', 10, 0, 'ACO');
136 // xl('Less-private information (write,addonly optional)')
138 // Create ACOs for lists.
140 $gacl->add_object('lists', 'Default List (write,addonly optional)', 'default', 10, 0, 'ACO');
141 // xl('Default List (write,addonly optional)')
142 $gacl->add_object('lists', 'State List (write,addonly optional)', 'state', 10, 0, 'ACO');
143 // xl('State List (write,addonly optional)')
144 $gacl->add_object('lists', 'Country List (write,addonly optional)', 'country', 10, 0, 'ACO');
145 // xl('Country List (write,addonly optional)')
146 $gacl->add_object('lists', 'Language List (write,addonly optional)', 'language', 10, 0, 'ACO');
147 // xl('Language List (write,addonly optional)')
148 $gacl->add_object('lists', 'Ethnicity-Race List (write,addonly optional)', 'ethrace', 10, 0, 'ACO');
149 // xl('Ethnicity-Race List (write,addonly optional)')
151 // Create ACOs for patientportal.
153 $gacl->add_object('patientportal', 'Patient Portal', 'portal', 10, 0, 'ACO');
154 // xl('Patient Portal')
156 // Create ACOs for modules.
158 $gacl->add_object('menus', 'Modules', 'modle', 10, 0, 'ACO');
161 // Create ACOs for patients.
163 $gacl->add_object('patients', 'Appointments (write,wsome optional)', 'appt', 10, 0, 'ACO');
164 // xl('Appointments (write,wsome optional)')
165 $gacl->add_object('patients', 'Demographics (write,addonly optional)', 'demo', 10, 0, 'ACO');
166 // xl('Demographics (write,addonly optional)')
167 $gacl->add_object('patients', 'Medical/History (write,addonly optional)', 'med', 10, 0, 'ACO');
168 // xl('Medical/History (write,addonly optional)')
169 $gacl->add_object('patients', 'Transactions (write optional)', 'trans', 10, 0, 'ACO');
170 // xl('Transactions (write optional)')
171 $gacl->add_object('patients', 'Documents (write,addonly optional)', 'docs', 10, 0, 'ACO');
172 // xl('Documents (write,addonly optional)')
173 $gacl->add_object('patients', 'Patient Notes (write,addonly optional)', 'notes', 10, 0, 'ACO');
174 // xl('Patient Notes (write,addonly optional)')
175 $gacl->add_object('patients', 'Sign Lab Results (write,addonly optional)', 'sign', 10, 0, 'ACO');
176 // xl('Sign Lab Results (write,addonly optional)')
177 $gacl->add_object('patients', 'Patient Reminders (write,addonly optional)', 'reminder', 10, 0, 'ACO');
178 // xl('Patient Reminders (write,addonly optional)')
179 $gacl->add_object('patients', 'Clinical Reminders/Alerts (write,addonly optional)', 'alert', 10, 0, 'ACO');
180 // xl('Clinical Reminders/Alerts (write,addonly optional)')
181 $gacl->add_object('patients', 'Disclosures (write,addonly optional)', 'disclosure', 10, 0, 'ACO');
182 // xl('Disclosures (write,addonly optional)')
183 $gacl->add_object('patients', 'Prescriptions (write,addonly optional)', 'rx', 10, 0, 'ACO');
184 // xl('Prescriptions (write,addonly optional)')
185 $gacl->add_object('patients', 'Amendments (write,addonly optional)', 'amendment', 10, 0, 'ACO');
186 // xl('Amendments (write,addonly optional)')
187 $gacl->add_object('patients', 'Lab Results (write,addonly optional)', 'lab', 10, 0, 'ACO');
188 // xl('Lab Results (write,addonly optional)')
191 $gacl->add_object('groups', 'View/Add/Update groups', 'gadd', 10, 0, 'ACO');
192 // xl('View/Add/Update groups')
193 $gacl->add_object('groups', 'View/Create/Update groups appointment in calendar', 'gcalendar', 10, 0, 'ACO');
194 // xl('View/Create/Update groups appointment in calendar')
195 $gacl->add_object('groups', 'Group encounter log', 'glog', 10, 0, 'ACO');
196 // xl('Group encounter log')
197 $gacl->add_object('groups', 'Group detailed log of appointment in patient record', 'gdlog', 10, 0, 'ACO');
198 // xl('Group detailed log of appointment in patient record')
199 $gacl->add_object('groups', 'Send message from the permanent group therapist to the personal therapist', 'gm', 10, 0, 'ACO');
200 // xl('Send message from the permanent group therapist to the personal therapist')
202 // Create ACOs for sensitivities.
204 $gacl->add_object('sensitivities', 'Normal', 'normal', 10, 0, 'ACO');
206 $gacl->add_object('sensitivities', 'High', 'high', 20, 0, 'ACO');
209 // Create ACO for placeholder.
211 $gacl->add_object('placeholder', 'Placeholder (Maintains empty ACLs)', 'filler', 10, 0, 'ACO');
212 // xl('Placeholder (Maintains empty ACLs)')
214 // Create ACO for nationnotes.
216 $gacl->add_object('nationnotes', 'Nation Notes Configure', 'nn_configure', 10, 0, 'ACO');
217 // xl('Nation Notes Configure')
219 // Create ARO groups.
221 $users = $gacl->add_group('users', 'OpenEMR Users', 0, 'ARO');
222 // xl('OpenEMR Users')
223 $admin = $gacl->add_group('admin', 'Administrators', $users, 'ARO');
224 // xl('Administrators')
225 $clin = $gacl->add_group('clin', 'Clinicians', $users, 'ARO');
227 $doc = $gacl->add_group('doc', 'Physicians', $users, 'ARO');
229 $front = $gacl->add_group('front', 'Front Office', $users, 'ARO');
230 // xl('Front Office')
231 $back = $gacl->add_group('back', 'Accounting', $users, 'ARO');
233 $breakglass = $gacl->add_group('breakglass', 'Emergency Login', $users, 'ARO');
234 // xl('Emergency Login')
237 // Create a Users section for the AROs (humans).
239 $gacl->add_object_section('Users', 'users', 10, 0, 'ARO');
242 // Create the Administrator in the above-created "users" section
243 // and add him/her to the above-created "admin" group.
244 // If this script is being used by OpenEMR's setup, then will
245 // incorporate the installation values. Otherwise will
246 // hardcode the 'admin' user.
247 if (isset($this) && isset($this->iuser
)) {
248 $gacl->add_object('users', $this->iuname
, $this->iuser
, 10, 0, 'ARO');
249 $gacl->add_group_object($admin, 'users', $this->iuser
, 'ARO');
251 $gacl->add_object('users', 'Administrator', 'admin', 10, 0, 'ARO');
252 $gacl->add_group_object($admin, 'users', 'admin', 'ARO');
255 // Declare return terms for language translations
256 // xl('write') xl('wsome') xl('addonly') xl('view')
258 // Set permissions for administrators.
262 'acct'=>array('bill', 'disc', 'eob', 'rep', 'rep_a'),
263 'admin'=>array('calendar', 'database', 'forms', 'practice', 'superbill', 'users', 'batchcom', 'language', 'super', 'drugs', 'acl','multipledb','menu','manage_modules'),
264 'encounters'=>array('auth_a', 'auth', 'coding_a', 'coding', 'notes_a', 'notes', 'date_a', 'relaxed'),
265 'lists'=>array('default','state','country','language','ethrace'),
266 'patients'=>array('appt', 'demo', 'med', 'trans', 'docs', 'notes', 'sign', 'reminder', 'alert', 'disclosure', 'rx', 'amendment', 'lab'),
267 'sensitivities'=>array('normal', 'high'),
268 'nationnotes'=>array('nn_configure'),
269 'patientportal'=>array('portal'),
270 'menus'=>array('modle'),
271 'groups'=>array('gadd','gcalendar','glog','gdlog','gm')
280 'Administrators can do anything'
282 // xl('Administrators can do anything')
284 // Set permissions for physicians.
288 'placeholder'=>array('filler')
297 'Things that physicians can only read'
299 // xl('Things that physicians can only read')
302 'placeholder'=>array('filler')
311 'Things that physicians can read and enter but not modify'
313 // xl('Things that physicians can read and enter but not modify')
316 'placeholder'=>array('filler')
325 'Things that physicians can read and partly modify'
327 // xl('Things that physicians can read and partly modify')
330 'acct'=>array('disc', 'rep'),
331 'admin'=>array('drugs'),
332 'encounters'=>array('auth_a', 'auth', 'coding_a', 'coding', 'notes_a', 'notes', 'date_a', 'relaxed'),
333 'patients' => array('appt', 'demo', 'med', 'trans', 'docs', 'notes', 'sign', 'reminder', 'alert',
334 'disclosure', 'rx', 'amendment', 'lab'),
335 'sensitivities'=>array('normal', 'high'),
336 'groups'=>array('gcalendar','glog')
345 'Things that physicians can read and modify'
347 // xl('Things that physicians can read and modify')
349 // Set permissions for clinicians.
353 'placeholder'=>array('filler')
362 'Things that clinicians can only read'
364 // xl('Things that clinicians can only read')
367 'encounters'=>array('notes', 'relaxed'),
368 'patients'=>array('demo', 'med', 'docs', 'notes','trans', 'reminder', 'alert', 'disclosure', 'rx', 'amendment', 'lab'),
369 'sensitivities'=>array('normal')
378 'Things that clinicians can read and enter but not modify'
380 // xl('Things that clinicians can read and enter but not modify')
383 'placeholder'=>array('filler')
392 'Things that clinicians can read and partly modify'
394 // xl('Things that clinicians can read and partly modify')
397 'admin'=>array('drugs'),
398 'encounters'=>array('coding'),
399 'patients'=>array('appt'),
400 'groups'=>array('gcalendar','glog')
409 'Things that clinicians can read and modify'
411 // xl('Things that clinicians can read and modify')
413 // Set permissions for front office staff.
417 'patients'=>array('alert')
426 'Things that front office can only read'
428 // xl('Things that front office can only read')
431 'placeholder'=>array('filler')
440 'Things that front office can read and enter but not modify'
442 // xl('Things that front office can read and enter but not modify')
445 'placeholder'=>array('filler')
454 'Things that front office can read and partly modify'
456 // xl('Things that front office can read and partly modify')
459 'patients'=>array('appt', 'demo', 'trans', 'notes'),
460 'groups'=>array('gcalendar')
469 'Things that front office can read and modify'
471 // xl('Things that front office can read and modify')
473 // Set permissions for back office staff.
477 'patients'=>array('alert')
486 'Things that back office can only read'
488 // xl('Things that back office can only read')
491 'placeholder'=>array('filler')
500 'Things that back office can read and enter but not modify'
502 // xl('Things that back office can read and enter but not modify')
505 'placeholder'=>array('filler')
514 'Things that back office can read and partly modify'
516 // xl('Things that back office can read and partly modify')
519 'acct'=>array('bill', 'disc', 'eob', 'rep', 'rep_a'),
520 'admin'=>array('practice', 'superbill'),
521 'encounters'=>array('auth_a', 'coding_a', 'date_a'),
522 'patients'=>array('appt', 'demo')
531 'Things that back office can read and modify'
533 // xl('Things that back office can read and modify')
535 // Set permissions for Emergency Login.
539 'acct'=>array('bill', 'disc', 'eob', 'rep', 'rep_a'),
540 'admin'=>array('calendar', 'database', 'forms', 'practice', 'superbill', 'users', 'batchcom', 'language', 'super', 'drugs', 'acl','multipledb','menu','manage_modules'),
541 'encounters'=>array('auth_a', 'auth', 'coding_a', 'coding', 'notes_a', 'notes', 'date_a', 'relaxed'),
542 'lists'=>array('default','state','country','language','ethrace'),
543 'patients'=>array('appt', 'demo', 'med', 'trans', 'docs', 'notes', 'sign', 'reminder', 'alert', 'disclosure', 'rx', 'amendment', 'lab'),
544 'sensitivities'=>array('normal', 'high'),
545 'nationnotes'=>array('nn_configure'),
546 'patientportal'=>array('portal'),
547 'menus'=>array('modle'),
548 'groups'=>array('gadd','gcalendar','glog','gdlog','gm')
557 'Emergency Login user can do anything'
559 // xl('Emergency Login user can do anything')
564 <title
>OpenEMR ACL Setup
</title
>
565 <link rel
=STYLESHEET href
="interface/themes/style_blue.css">
568 <b
>OpenEMR ACL Setup
</b
>
570 All done configuring
and installing access
controls (php
-GACL
)!