4 * This program is run by the OpenEMR setup.php script to install phpGACL
5 * and creates the Access Control Objects and their sections.
6 * See src/Common/Acl/AclMain.php file for the list of
7 * currently supported Access Control Objects(ACO), which this
8 * script will install. This script also creates several
9 * ARO groups, an "admin" ARO, and some reasonable ACL entries for
13 * Physicians (Doctors)
14 * Clinicians (Nurses, Physician Assistants, etc.)
15 * Front Office (Receptionist)
19 * When upgrading to a new version of OpenEMR, run the acl_upgrade.php
20 * script to update the phpGACL access controls. This is required to
21 * ensure the database includes all the required Access Control
25 * @link http://www.open-emr.org
26 * @author Rod Roark <rod@sunsetsystems.com>
27 * @author Brady Miller <brady.g.miller@gmail.com>
28 * @copyright Copyright (c) 2005-2017 Rod Roark <rod@sunsetsystems.com>
29 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
30 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
33 use OpenEMR\Gacl\GaclApi
;
35 $gacl = new GaclApi();
37 // Create the ACO sections. Every ACO must have a section.
39 if ($gacl->add_object_section('Accounting', 'acct', 10, 0, 'ACO') === false) {
40 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.php).<br>";
44 $gacl->add_object_section('Administration', 'admin', 10, 0, 'ACO');
45 // xl('Administration')
46 $gacl->add_object_section('Encounters', 'encounters', 10, 0, 'ACO');
48 $gacl->add_object_section('Lists', 'lists', 10, 0, 'ACO');
50 $gacl->add_object_section('Patients', 'patients', 10, 0, 'ACO');
52 $gacl->add_object_section('Squads', 'squads', 10, 0, 'ACO');
54 $gacl->add_object_section('Sensitivities', 'sensitivities', 10, 0, 'ACO');
55 // xl('Sensitivities')
56 $gacl->add_object_section('Placeholder', 'placeholder', 10, 0, 'ACO');
58 $gacl->add_object_section('Nation Notes', 'nationnotes', 10, 0, 'ACO');
60 $gacl->add_object_section('Patient Portal', 'patientportal', 10, 0, 'ACO');
61 // xl('Patient Portal')
62 $gacl->add_object_section('Menus', 'menus', 10, 0, 'ACO');
64 $gacl->add_object_section('Groups', 'groups', 10, 0, 'ACO');
69 // Create Accounting ACOs.
71 $gacl->add_object('acct', 'Billing (write optional)', 'bill', 10, 0, 'ACO');
72 // xl('Billing (write optional)')
73 $gacl->add_object('acct', 'Price Discounting', 'disc', 10, 0, 'ACO');
74 // xl('Price Discounting')
75 $gacl->add_object('acct', 'EOB Data Entry', 'eob', 10, 0, 'ACO');
76 // xl('EOB Data Entry')
77 $gacl->add_object('acct', 'Financial Reporting - my encounters', 'rep', 10, 0, 'ACO');
78 // xl('Financial Reporting - my encounters')
79 $gacl->add_object('acct', 'Financial Reporting - anything', 'rep_a', 10, 0, 'ACO');
80 // xl('Financial Reporting - anything')
82 // Create Administration ACOs.
84 $gacl->add_object('admin', 'Superuser', 'super', 10, 0, 'ACO');
86 $gacl->add_object('admin', 'Calendar Settings', 'calendar', 10, 0, 'ACO');
87 // xl('Calendar Settings')
88 $gacl->add_object('admin', 'Database Reporting', 'database', 10, 0, 'ACO');
89 // xl('Database Reporting')
90 $gacl->add_object('admin', 'Forms Administration', 'forms', 10, 0, 'ACO');
91 // xl('Forms Administration')
92 $gacl->add_object('admin', 'Practice Settings', 'practice', 10, 0, 'ACO');
93 // xl('Practice Settings')
94 $gacl->add_object('admin', 'Superbill Codes Administration', 'superbill', 10, 0, 'ACO');
95 // xl('Superbill Codes Administration')
96 $gacl->add_object('admin', 'Users/Groups/Logs Administration', 'users', 10, 0, 'ACO');
97 // xl('Users/Groups/Logs Administration')
98 $gacl->add_object('admin', 'Batch Communication Tool', 'batchcom', 10, 0, 'ACO');
99 // xl('Batch Communication Tool')
100 $gacl->add_object('admin', 'Language Interface Tool', 'language', 10, 0, 'ACO');
101 // xl('Language Interface Tool')
102 $gacl->add_object('admin', 'Pharmacy Dispensary', 'drugs', 10, 0, 'ACO');
103 // xl('Pharmacy Dispensary')
104 $gacl->add_object('admin', 'ACL Administration', 'acl', 10, 0, 'ACO');
105 // xl('ACL Administration')
106 $gacl->add_object('admin', 'Multipledb', 'multipledb', 10, 0, 'ACO');
108 $gacl->add_object('admin', 'Menu', 'menu', 10, 0, 'ACO');
110 $gacl->add_object('admin', 'Manage modules', 'manage_modules', 10, 0, 'ACO');
111 // xl('Manage modules')
114 // Create ACOs for encounters.
116 $gacl->add_object('encounters', 'Authorize - my encounters', 'auth', 10, 0, 'ACO');
117 // xl('Authorize - my encounters')
118 $gacl->add_object('encounters', 'Authorize - any encounters', 'auth_a', 10, 0, 'ACO');
119 // xl('Authorize - any encounters')
120 $gacl->add_object('encounters', 'Coding - my encounters (write,wsome optional)', 'coding', 10, 0, 'ACO');
121 // xl('Coding - my encounters (write,wsome optional)')
122 $gacl->add_object('encounters', 'Coding - any encounters (write,wsome optional)', 'coding_a', 10, 0, 'ACO');
123 // xl('Coding - any encounters (write,wsome optional)')
124 $gacl->add_object('encounters', 'Notes - my encounters (write,addonly optional)', 'notes', 10, 0, 'ACO');
125 // xl('Notes - my encounters (write,addonly optional)')
126 $gacl->add_object('encounters', 'Notes - any encounters (write,addonly optional)', 'notes_a', 10, 0, 'ACO');
127 // xl('Notes - any encounters (write,addonly optional)')
128 $gacl->add_object('encounters', 'Fix encounter dates - any encounters', 'date_a', 10, 0, 'ACO');
129 // xl('Fix encounter dates - any encounters')
130 $gacl->add_object('encounters', 'Less-private information (write,addonly optional)', 'relaxed', 10, 0, 'ACO');
131 // xl('Less-private information (write,addonly optional)')
133 // Create ACOs for lists.
135 $gacl->add_object('lists', 'Default List (write,addonly optional)', 'default', 10, 0, 'ACO');
136 // xl('Default List (write,addonly optional)')
137 $gacl->add_object('lists', 'State List (write,addonly optional)', 'state', 10, 0, 'ACO');
138 // xl('State List (write,addonly optional)')
139 $gacl->add_object('lists', 'Country List (write,addonly optional)', 'country', 10, 0, 'ACO');
140 // xl('Country List (write,addonly optional)')
141 $gacl->add_object('lists', 'Language List (write,addonly optional)', 'language', 10, 0, 'ACO');
142 // xl('Language List (write,addonly optional)')
143 $gacl->add_object('lists', 'Ethnicity-Race List (write,addonly optional)', 'ethrace', 10, 0, 'ACO');
144 // xl('Ethnicity-Race List (write,addonly optional)')
146 // Create ACOs for patientportal.
148 $gacl->add_object('patientportal', 'Patient Portal', 'portal', 10, 0, 'ACO');
149 // xl('Patient Portal')
151 // Create ACOs for modules.
153 $gacl->add_object('menus', 'Modules', 'modle', 10, 0, 'ACO');
156 // Create ACOs for patients.
158 $gacl->add_object('patients', 'Appointments (write,wsome optional)', 'appt', 10, 0, 'ACO');
159 // xl('Appointments (write,wsome optional)')
160 $gacl->add_object('patients', 'Demographics (write,addonly optional)', 'demo', 10, 0, 'ACO');
161 // xl('Demographics (write,addonly optional)')
162 $gacl->add_object('patients', 'Medical/History (write,addonly optional)', 'med', 10, 0, 'ACO');
163 // xl('Medical/History (write,addonly optional)')
164 $gacl->add_object('patients', 'Transactions (write optional)', 'trans', 10, 0, 'ACO');
165 // xl('Transactions (write optional)')
166 $gacl->add_object('patients', 'Documents (write,addonly optional)', 'docs', 10, 0, 'ACO');
167 // xl('Documents (write,addonly optional)')
168 $gacl->add_object('patients', 'Documents Delete', 'docs_rm', 10, 0, 'ACO');
169 // xl('Documents Delete')
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)')
186 $gacl->add_object('patients', 'Patient Report', 'pat_rep', 10, 0, 'ACO');
187 // xl('Patient Report')
190 $gacl->add_object('groups', 'View/Add/Update groups', 'gadd', 10, 0, 'ACO');
191 // xl('View/Add/Update groups')
192 $gacl->add_object('groups', 'View/Create/Update groups appointment in calendar', 'gcalendar', 10, 0, 'ACO');
193 // xl('View/Create/Update groups appointment in calendar')
194 $gacl->add_object('groups', 'Group encounter log', 'glog', 10, 0, 'ACO');
195 // xl('Group encounter log')
196 $gacl->add_object('groups', 'Group detailed log of appointment in patient record', 'gdlog', 10, 0, 'ACO');
197 // xl('Group detailed log of appointment in patient record')
198 $gacl->add_object('groups', 'Send message from the permanent group therapist to the personal therapist', 'gm', 10, 0, 'ACO');
199 // xl('Send message from the permanent group therapist to the personal therapist')
201 // Create ACOs for sensitivities.
203 $gacl->add_object('sensitivities', 'Normal', 'normal', 10, 0, 'ACO');
205 $gacl->add_object('sensitivities', 'High', 'high', 20, 0, 'ACO');
208 // Create ACO for placeholder.
210 $gacl->add_object('placeholder', 'Placeholder (Maintains empty ACLs)', 'filler', 10, 0, 'ACO');
211 // xl('Placeholder (Maintains empty ACLs)')
213 // Create ACO for nationnotes.
215 $gacl->add_object('nationnotes', 'Nation Notes Configure', 'nn_configure', 10, 0, 'ACO');
216 // xl('Nation Notes Configure')
218 // Create ARO groups.
220 $users = $gacl->add_group('users', 'OpenEMR Users', 0, 'ARO');
221 // xl('OpenEMR Users')
222 $admin = $gacl->add_group('admin', 'Administrators', $users, 'ARO');
223 // xl('Administrators')
224 $clin = $gacl->add_group('clin', 'Clinicians', $users, 'ARO');
226 $doc = $gacl->add_group('doc', 'Physicians', $users, 'ARO');
228 $front = $gacl->add_group('front', 'Front Office', $users, 'ARO');
229 // xl('Front Office')
230 $back = $gacl->add_group('back', 'Accounting', $users, 'ARO');
232 $breakglass = $gacl->add_group('breakglass', 'Emergency Login', $users, 'ARO');
233 // xl('Emergency Login')
236 // Create a Users section for the AROs (humans).
238 $gacl->add_object_section('Users', 'users', 10, 0, 'ARO');
241 // Create the Administrator in the above-created "users" section
242 // and add him/her to the above-created "admin" group.
243 // If this script is being used by OpenEMR's setup, then will
244 // incorporate the installation values. Otherwise will
245 // hardcode the 'admin' user.
246 if (isset($this) && isset($this->iuser
)) {
247 $gacl->add_object('users', $this->iuname
, $this->iuser
, 10, 0, 'ARO');
248 $gacl->add_group_object($admin, 'users', $this->iuser
, 'ARO');
250 $gacl->add_object('users', 'Administrator', 'admin', 10, 0, 'ARO');
251 $gacl->add_group_object($admin, 'users', 'admin', 'ARO');
254 // Declare return terms for language translations
255 // xl('write') xl('wsome') xl('addonly') xl('view')
257 // Set permissions for administrators.
261 'acct' => array('bill', 'disc', 'eob', 'rep', 'rep_a'),
262 'admin' => array('calendar', 'database', 'forms', 'practice', 'superbill', 'users', 'batchcom', 'language', 'super', 'drugs', 'acl','multipledb','menu','manage_modules'),
263 'encounters' => array('auth_a', 'auth', 'coding_a', 'coding', 'notes_a', 'notes', 'date_a', 'relaxed'),
264 'lists' => array('default','state','country','language','ethrace'),
265 'patients' => array('appt', 'demo', 'med', 'trans', 'docs', 'notes', 'sign', 'reminder', 'alert', 'disclosure', 'rx', 'amendment', 'lab', 'docs_rm','pat_rep'),
266 'sensitivities' => array('normal', 'high'),
267 'nationnotes' => array('nn_configure'),
268 'patientportal' => array('portal'),
269 'menus' => array('modle'),
270 'groups' => array('gadd','gcalendar','glog','gdlog','gm')
279 'Administrators can do anything'
281 // xl('Administrators can do anything')
283 // Set permissions for physicians.
287 'patients' => array('pat_rep')
296 'Things that physicians can only read'
298 // xl('Things that physicians can only read')
301 'placeholder' => array('filler')
310 'Things that physicians can read and enter but not modify'
312 // xl('Things that physicians can read and enter but not modify')
315 'placeholder' => array('filler')
324 'Things that physicians can read and partly modify'
326 // xl('Things that physicians can read and partly modify')
329 'acct' => array('disc', 'rep'),
330 'admin' => array('drugs'),
331 'encounters' => array('auth_a', 'auth', 'coding_a', 'coding', 'notes_a', 'notes', 'date_a', 'relaxed'),
332 'patients' => array('appt', 'demo', 'med', 'trans', 'docs', 'notes', 'sign', 'reminder', 'alert',
333 'disclosure', 'rx', 'amendment', 'lab'),
334 'sensitivities' => array('normal', 'high'),
335 'groups' => array('gcalendar','glog')
344 'Things that physicians can read and modify'
346 // xl('Things that physicians can read and modify')
348 // Set permissions for clinicians.
352 'patients' => array('pat_rep')
361 'Things that clinicians can only read'
363 // xl('Things that clinicians can only read')
366 'encounters' => array('notes', 'relaxed'),
367 'patients' => array('demo', 'med', 'docs', 'notes','trans', 'reminder', 'alert', 'disclosure', 'rx', 'amendment', 'lab'),
368 'sensitivities' => array('normal')
377 'Things that clinicians can read and enter but not modify'
379 // xl('Things that clinicians can read and enter but not modify')
382 'placeholder' => array('filler')
391 'Things that clinicians can read and partly modify'
393 // xl('Things that clinicians can read and partly modify')
396 'admin' => array('drugs'),
397 'encounters' => array('coding'),
398 'patients' => array('appt'),
399 'groups' => array('gcalendar','glog')
408 'Things that clinicians can read and modify'
410 // xl('Things that clinicians can read and modify')
412 // Set permissions for front office staff.
416 'patients' => array('alert','pat_rep')
425 'Things that front office can only read'
427 // xl('Things that front office can only read')
430 'placeholder' => array('filler')
439 'Things that front office can read and enter but not modify'
441 // xl('Things that front office can read and enter but not modify')
444 'placeholder' => array('filler')
453 'Things that front office can read and partly modify'
455 // xl('Things that front office can read and partly modify')
458 'patients' => array('appt', 'demo', 'trans', 'notes'),
459 'groups' => array('gcalendar')
468 'Things that front office can read and modify'
470 // xl('Things that front office can read and modify')
472 // Set permissions for back office staff.
476 'patients' => array('alert','pat_rep')
485 'Things that back office can only read'
487 // xl('Things that back office can only read')
490 'placeholder' => array('filler')
499 'Things that back office can read and enter but not modify'
501 // xl('Things that back office can read and enter but not modify')
504 'placeholder' => array('filler')
513 'Things that back office can read and partly modify'
515 // xl('Things that back office can read and partly modify')
518 'acct' => array('bill', 'disc', 'eob', 'rep', 'rep_a'),
519 'admin' => array('practice', 'superbill'),
520 'encounters' => array('auth_a', 'coding_a', 'date_a'),
521 'patients' => array('appt', 'demo')
530 'Things that back office can read and modify'
532 // xl('Things that back office can read and modify')
534 // Set permissions for Emergency Login.
538 'acct' => array('bill', 'disc', 'eob', 'rep', 'rep_a'),
539 'admin' => array('calendar', 'database', 'forms', 'practice', 'superbill', 'users', 'batchcom', 'language', 'super', 'drugs', 'acl','multipledb','menu','manage_modules'),
540 'encounters' => array('auth_a', 'auth', 'coding_a', 'coding', 'notes_a', 'notes', 'date_a', 'relaxed'),
541 'lists' => array('default','state','country','language','ethrace'),
542 'patients' => array('appt', 'demo', 'med', 'trans', 'docs', 'notes', 'sign', 'reminder', 'alert', 'disclosure', 'rx', 'amendment', 'lab', 'docs_rm','pat_rep'),
543 'sensitivities' => array('normal', 'high'),
544 'nationnotes' => array('nn_configure'),
545 'patientportal' => array('portal'),
546 'menus' => array('modle'),
547 'groups' => array('gadd','gcalendar','glog','gdlog','gm')
556 'Emergency Login user can do anything'
558 // xl('Emergency Login user can do anything')
563 <title
>OpenEMR ACL Setup
</title
>
564 <link rel
=STYLESHEET href
="interface/themes/style_blue.css">
567 <b
>OpenEMR ACL Setup
</b
>
569 All done configuring
and installing access
controls (php
-GACL
)!