OpenEMR minimum web technologies requirements (#443)
[openemr.git] / acl_upgrade.php
blob447a19000196d0ec70e1b7ad778c2001fd93c4af
1 <?php
2 /**
3 * Upgrade script for access controls.
5 * This script will update the phpGACL database, which include
6 * Access Control Objects(ACO), Groups(ARO), and Access Control
7 * Lists(ACL) to the most recent version.
8 * It will display whether each update already exist
9 * or if it was updated succesfully.
10 * To avoid reversing customizations, upgrade is done in versions,
11 * which are recorded in the database. To add another version of
12 * changes, use the following template:
13 * <pre>// Upgrade for acl_version <acl_version_here>
14 * $upgrade_acl = <acl_version_here>;
15 * if ($acl_version < $upgrade_acl) {
16 * echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
18 * //Collect the ACL ID numbers.
19 * echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
21 * //Add new object Sections
22 * echo "<BR/><B>Adding new object sections</B><BR/>";
24 * //Add new Objects
25 * echo "<BR/><B>Adding new objects</B><BR/>";
27 * //Update already existing Objects
28 * echo "<BR/><B>Upgrading objects</B><BR/>";
30 * //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
31 * // (will also place in the appropriate group and CREATE a new group if needed)
32 * echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
34 * //Update the ACLs
35 * echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
37 * //DONE with upgrading to this version
38 * $acl_version = $upgrade_acl;
39 * }
40 * </pre>
42 * Updates included:
43 * <pre>---VERSION 1 ACL---
44 * 2.8.2
45 * Section "sensitivities" (Sensitivities):
46 * ADD normal Normal (Administrators, Physicians, Clinicians(addonly))
47 * ADD high High (Administrators, Physicians)
48 * Section "admin" (Administration):
49 * ADD super Superuser (Adminstrators)
50 * 2.8.4
51 * Section "admin" (Administration):
52 * ADD drugs Pharmacy Dispensary (Administrators, Physicians, Clinicians(write))
53 * ADD acl ACL Administration (Administrators)
54 * Section "sensitivities" (Sensitivities):
55 * EDIT high High (ensure the order variable is '20')
56 * Section "acct" (Accounting):
57 * ADD disc Price Discounting (Administrators, Physicians, Accounting(write))
58 * 3.0.2
59 * ADD Section "lists" (Lists):
60 * ADD default Default List (write,addonly optional) (Administrators)
61 * ADD state State List (write,addonly optional) (Administrators)
62 * ADD country Country List (write,addonly optional) (Administrators)
63 * ADD language Language List (write,addonly optional) (Administrators)
64 * ADD ethrace Ethnicity-Race List (write,addonly optional) (Administrators)
65 * ADD Section "placeholder" (Placeholder):
66 * ADD filler Placeholder (Maintains empty ACLs)
67 * ACL/Group doc addonly "Physicians" (filler aco)
68 * ACL/Group front addonly "Front Office" (filler aco)
69 * ACL/Group back addonly "Accounting" (filler aco)
70 * 3.3.0
71 * Section "patients" (Patients):
72 * ADD sign Sign Lab Results (Physicians)
73 * ACL/Group breakglass write "Emergency Login" (added all aco's to it)
74 * 4.1.0
75 * Section "nationnotes" (Nation Notes)
76 * ADD nn_configure Nation Notes Configure (Administrators, Emergency Login)
77 * Section "patientportal" (Patient Portal)
78 * ADD portal Patient Portal (Administrators, Emergency Login)
79 * 4.1.1
80 * ACL/Group doc wsome "Physicians" (filler aco)
81 * ACL/Group clin wsome "Clinicians" (filler aco)
82 * ACL/Group front wsome "Front Office" (filler aco)
83 * ACL/Group back wsome "Accounting" (filler aco)
84 * ACL/Group doc view "Physicians" (filler aco)
85 * ACL/Group clin view "Clinicians" (filler aco)
86 * ACL/Group front view "Front Office" (filler aco)
87 * ACL/Group back view "Accounting" (filler aco)
88 * 4.1.3
89 * Section "menus" (Menus)
90 * ADD modle Module (Administrators, Emergency Login)
91 * </pre>
93 * Copyright (C) 2012 Brady Miller <brady@sparmy.com>
95 * LICENSE: This program is free software; you can redistribute it and/or
96 * modify it under the terms of the GNU General Public License
97 * as published by the Free Software Foundation; either version 2
98 * of the License, or (at your option) any later version.
99 * This program is distributed in the hope that it will be useful,
100 * but WITHOUT ANY WARRANTY; without even the implied warranty of
101 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
102 * GNU General Public License for more details.
103 * You should have received a copy of the GNU General Public License
104 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>.
106 * @package OpenEMR
107 * @author Brady Miller <brady@sparmy.com>
108 * @link http://www.open-emr.org
111 // Checks if the server's PHP version is compatible with OpenEMR:
112 require_once(dirname(__FILE__) . "/common/compatibility/checker.php");
114 $response = Checker::checkPhpVersion();
115 if ($response !== true) {
116 die($response);
119 $ignoreAuth = true; // no login required
121 require_once('interface/globals.php');
122 require_once("$srcdir/acl_upgrade_fx.php");
124 //Ensure that phpGACL has been installed
125 include_once('library/acl.inc');
126 if (isset ($phpgacl_location)) {
127 include_once("$phpgacl_location/gacl_api.class.php");
128 $gacl = new gacl_api();
130 else {
131 die("You must first set up library/acl.inc to use phpGACL!");
134 $acl_version = get_acl_version();
135 if (empty($acl_version)) {
136 $acl_version = 0;
139 // Upgrade for acl_version 1
140 $upgrade_acl = 1;
141 if ($acl_version < $upgrade_acl) {
142 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
144 //Collect the ACL ID numbers.
145 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
146 //Get Administrator ACL ID number
147 $admin_write = getAclIdNumber('Administrators', 'write');
148 //Get Doctor ACL ID Number
149 $doc_write = getAclIdNumber('Physicians', 'write');
150 //Get Clinician ACL with write access ID number
151 $clin_write = getAclIdNumber('Clinicians', 'write');
152 //Get Clinician ACL with addonly access ID number
153 $clin_addonly = getAclIdNumber('Clinicians', 'addonly');
154 //Get Receptionist ACL ID number
155 $front_write = getAclIdNumber('Front Office', 'write');
156 //Get Accountant ACL ID number
157 $back_write = getAclIdNumber('Accounting', 'write');
159 //Add new object Sections
160 echo "<BR/><B>Adding new object sections</B><BR/>";
161 //Add 'Sensitivities' object section (added in 2.8.2)
162 addObjectSectionAcl('sensitivities', 'Sensitivities');
163 //Add 'Lists' object section (added in 3.0.2)
164 addObjectSectionAcl('lists', 'Lists');
165 //Add 'Placeholder' object section (added in 3.0.2)
166 addObjectSectionAcl('placeholder', 'Placeholder');
167 //Add 'Nation Notes' object section (added in 4.1.0)
168 addObjectSectionAcl('nationnotes','Nation Notes');
169 //Add 'Patient Portal' object section (added in 4.1.0)
170 addObjectSectionAcl('patientportal', 'Patient Portal');
172 //Add new Objects
173 echo "<BR/><B>Adding new objects</B><BR/>";
174 //Add 'Normal' sensitivity object, order variable is default 10 (added in 2.8.2)
175 addObjectAcl('sensitivities', 'Sensitivities', 'normal', 'Normal');
176 //Add 'High' sensitivity object, order variable is set to 20 (added in 2.8.2)
177 addObjectAclWithOrder('sensitivities', 'Sensitivities', 'high', 'High', 20);
178 //Add 'Pharmacy Dispensary' object (added in 2.8.4)
179 addObjectAcl('admin', 'Administration', 'drugs', 'Pharmacy Dispensary');
180 //Add 'ACL Administration' object (added in 2.8.4)
181 addObjectAcl('admin', 'Administration', 'acl', 'ACL Administration');
182 //Add 'Price Discounting' object (added in 2.8.4)
183 addObjectAcl('acct', 'Accounting', 'disc', 'Price Discounting');
184 //Add 'Default List (write,addonly optional)' object (added in 3.0.2)
185 addObjectAcl('lists', 'Lists', 'default', 'Default List (write,addonly optional)');
186 //Add 'State List (write,addonly optional)' object (added in 3.0.2)
187 addObjectAcl('lists', 'Lists', 'state', 'State List (write,addonly optional)');
188 //Add 'Country List (write,addonly optional)' object (added in 3.0.2)
189 addObjectAcl('lists', 'Lists', 'country', 'Country List (write,addonly optional)');
190 //Add 'Language List (write,addonly optional)' object (added in 3.0.2)
191 addObjectAcl('lists', 'Lists', 'language', 'Language List (write,addonly optional)');
192 //Add 'Ethnicity-Race List (write,addonly optional)' object (added in 3.0.2)
193 addObjectAcl('lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)');
194 //Add 'Placeholder (Maintains empty ACLs)' object (added in 3.0.2)
195 addObjectAcl('placeholder', 'Placeholder', 'filler', 'Placeholder (Maintains empty ACLs)');
196 //Add 'Sign Lab Results (write,addonly optional)' object (added in 3.3.0)
197 addObjectAcl('patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)');
198 //Add 'nationnotes' object (added in 4.1.0)
199 addObjectAcl('nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure');
200 //Add 'patientportal' object (added in 4.1.0)
201 addObjectAcl('patientportal', 'Patient Portal', 'portal', 'Patient Portal');
203 //Update already existing Objects
204 echo "<BR/><B>Upgrading objects</B><BR/>";
205 //Ensure that 'High' sensitivity object order variable is set to 20
206 editObjectAcl('sensitivities', 'Sensitivities', 'high', 'High', 20);
208 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
209 // (will also place in the appropriate group and CREATE a new group if needed)
210 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
211 //Add 'Physicians' ACL with 'addonly' and collect the ID number (added in 3.0.2)
212 $doc_addonly = addNewACL('Physicians', 'doc', 'addonly', 'Things that physicians can read and enter but not modify');
213 //Add 'Front Office' ACL with 'addonly' and collect the ID number (added in 3.0.2)
214 $front_addonly = addNewACL('Front Office', 'front', 'addonly', 'Things that front office can read and enter but not modify');
215 //Add 'Accounting' ACL with 'addonly' and collect the ID number (added in 3.0.2)
216 $back_addonly = addNewACL('Accounting', 'back', 'addonly', 'Things that back office can read and enter but not modify');
217 //Add 'Emergency Login' ACL with 'write' and collect the ID number (added in 3.3.0)
218 $emergency_write = addNewACL('Emergency Login', 'breakglass', 'write', 'Things that can use for emergency login, can read and modify');
220 //Update the ACLs
221 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
222 //Insert the 'super' object from the 'admin' section into the Administrators group write ACL (added in 2.8.2)
223 updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'super', 'Superuser', 'write');
224 //Insert the 'high' object from the 'sensitivities' section into the Administrators group write ACL (added in 2.8.2)
225 updateAcl($admin_write, 'Administrators', 'sensitivities', 'Sensitivities', 'high', 'High', 'write');
226 //Insert the 'normal' object from the 'sensitivities' section into the Administrators group write ACL (added in 2.8.2)
227 updateAcl($admin_write, 'Administrators', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write');
228 //Insert the 'high' object from the 'sensitivities' section into the Physicians group write ACL (added in 2.8.2)
229 updateAcl($doc_write, 'Physicians', 'sensitivities', 'Sensitivities', 'high', 'High', 'write');
230 //Insert the 'normal' object from the 'sensitivities' section into the Physicians group write ACL (added in 2.8.2)
231 updateAcl($doc_write, 'Physicians', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write');
232 //Insert the 'normal' object from the 'sensitivities' section into the Clinicians group addonly ACL (added in 2.8.2)
233 updateAcl($clin_addonly, 'Clinicians', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'addonly');
234 //Insert the 'drugs' object from the 'admin' section into the Administrators group write ACL (added in 2.8.4)
235 updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
236 //Insert the 'drugs' object from the 'admin' section into the Physicians group write ACL (added in 2.8.4)
237 updateAcl($doc_write, 'Physicians', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
238 //Insert the 'drugs' object from the 'admin' section into the Clinicians group write ACL (added in 2.8.4)
239 updateAcl($clin_write, 'Clinicians', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
240 //Insert the 'acl' object from the 'admin' section into the Administrators group write ACL (added in 2.8.4)
241 updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'acl', 'ACL Administration', 'write');
242 //Insert the 'disc' object from the 'acct' section into the Administrators group write ACL (added in 2.8.4)
243 updateAcl($admin_write, 'Administrators', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
244 //Insert the 'disc' object from the 'acct' section into the Accounting group write ACL (added in 2.8.4)
245 updateAcl($back_write, 'Accounting', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
246 //Insert the 'disc' object from the 'acct' section into the Physicians group write ACL (added in 2.8.4)
247 updateAcl($doc_write, 'Physicians', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
248 //Insert the 'default' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
249 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'default', 'Default List (write,addonly optional)', 'write');
250 //Insert the 'state' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
251 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'state', 'State List (write,addonly optional)', 'write');
252 //Insert the 'country' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
253 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'country', 'Country List (write,addonly optional)', 'write');
254 //Insert the 'language' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
255 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'language', 'Language List (write,addonly optional)', 'write');
256 //Insert the 'race' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
257 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)', 'write');
258 //Update ACLs for Emergency Login
259 //Insert the 'disc' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
260 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
261 //Insert the 'bill' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
262 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'bill', 'Billing (write optional)', 'write');
263 //Insert the 'eob' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
264 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'eob', 'EOB Data Entry', 'write');
265 //Insert the 'rep' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
266 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'rep', 'Financial Reporting - my encounters', 'write');
267 //Insert the 'rep_a' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
268 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'rep_a', 'Financial Reporting - anything', 'write');
269 //Insert the 'calendar' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
270 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'calendar', 'Calendar Settings', 'write');
271 //Insert the 'database' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
272 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'database', 'Database Reporting', 'write');
273 //Insert the 'forms' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
274 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'forms', 'Forms Administration', 'write');
275 //Insert the 'practice' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
276 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'practice', 'Practice Settings', 'write');
277 //Insert the 'superbill' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
278 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'superbill', 'Superbill Codes Administration', 'write');
279 //Insert the 'users' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
280 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'users', 'Users/Groups/Logs Administration', 'write');
281 //Insert the 'batchcom' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
282 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'batchcom', 'Batch Communication Tool', 'write');
283 //Insert the 'language' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
284 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'language', 'Language Interface Tool', 'write');
285 //Insert the 'super' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
286 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'super', 'Superuser', 'write');
287 //Insert the 'drugs' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
288 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
289 //Insert the 'acl' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
290 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'acl', 'ACL Administration', 'write');
291 //Insert the 'auth_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
292 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'auth_a', 'Authorize - any encounters', 'write');
293 //Insert the 'coding_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
294 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'coding_a', 'Coding - any encounters (write,wsome optional)', 'write');
295 //Insert the 'notes_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
296 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'notes_a', 'Notes - any encounters (write,addonly optional)', 'write');
297 //Insert the 'date_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
298 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'date_a', 'Fix encounter dates - any encounters', 'write');
299 //Insert the 'default' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
300 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'default', 'Default List (write,addonly optional)', 'write');
301 //Insert the 'state' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
302 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'state', 'State List (write,addonly optional)', 'write');
303 //Insert the 'country' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
304 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'country', 'Country List (write,addonly optional)', 'write');
305 //Insert the 'language' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
306 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'language', 'Language List (write,addonly optional)', 'write');
307 //Insert the 'ethrace' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
308 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)', 'write');
309 //Insert the 'appt' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
310 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'appt', 'Appointments (write,wsome optional)', 'write');
311 //Insert the 'demo' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
312 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'demo', 'Demographics (write,addonly optional)', 'write');
313 //Insert the 'med' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
314 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'med', 'Medical/History (write,addonly optional)', 'write');
315 //Insert the 'trans' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
316 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'trans', 'Transactions (write optional)', 'write');
317 //Insert the 'docs' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
318 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'docs', 'Documents (write,addonly optional)', 'write');
319 //Insert the 'notes' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
320 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'notes', 'Patient Notes (write,addonly optional)', 'write');
321 //Insert the 'high' object from the 'sensitivities' section into the Emergency Login group write ACL (added in 3.3.0)
322 updateAcl($emergency_write, 'Emergency Login', 'sensitivities', 'Sensitivities', 'high', 'High', 'write');
323 //Insert the 'normal' object from the 'sensitivities' section into the Emergency Login group write ACL (added in 3.3.0)
324 updateAcl($emergency_write, 'Emergency Login', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write');
325 //Insert the 'sign' object from the 'patients' section into the Physicians group write ACL (added in 3.3.0)
326 updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)', 'write');
327 //Insert the 'sign' object from the 'nationnotes' section into the Administrators group write ACL (added in 3.3.0)
328 updateAcl($admin_write, 'Administrators','nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure','write');
329 //Insert the 'sign' object from the 'nationnotes' section into the Emergency Login group write ACL (added in 3.3.0)
330 updateAcl($emergency_write, 'Emergency Login','nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure','write');
331 //Insert the 'patientportal' object from the 'patientportal' section into the Administrators group write ACL (added in 4.1.0)
332 updateAcl($admin_write, 'Administrators','patientportal', 'Patient Portal', 'portal', 'Patient Portal','write');
333 //Insert the 'patientportal' object from the 'patientportal' section into the Emergency Login group write ACL (added in 4.1.0)
334 updateAcl($emergency_write, 'Emergency Login','patientportal', 'Patient Portal', 'portal', 'Patient Portal','write');
336 //DONE with upgrading to this version
337 $acl_version = $upgrade_acl;
340 // Upgrade for acl_version 2
341 $upgrade_acl = 2;
342 if ($acl_version < $upgrade_acl) {
343 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
345 //Collect the ACL ID numbers.
346 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
348 //Add new object Sections
349 echo "<BR/><B>Adding new object sections</B><BR/>";
351 //Add new Objects
352 echo "<BR/><B>Adding new objects</B><BR/>";
354 //Update already existing Objects
355 echo "<BR/><B>Upgrading objects</B><BR/>";
357 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
358 // (will also place in the appropriate group and CREATE a new group if needed)
359 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
360 addNewACL('Physicians', 'doc', 'wsome', 'Things that physicians can read and partly modify');
361 addNewACL('Clinicians', 'clin', 'wsome', 'Things that clinicians can read and partly modify');
362 addNewACL('Front Office', 'front', 'wsome', 'Things that front office can read and partly modify');
363 addNewACL('Accounting', 'back', 'wsome', 'Things that back office can read and partly modify');
364 addNewACL('Physicians', 'doc', 'view', 'Things that physicians can only read');
365 addNewACL('Clinicians', 'clin', 'view', 'Things that clinicians can only read');
366 addNewACL('Front Office', 'front', 'view', 'Things that front office can only read');
367 addNewACL('Accounting', 'back', 'view', 'Things that back office can only read');
369 //Update the ACLs
370 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
372 //DONE with upgrading to this version
373 $acl_version = $upgrade_acl;
376 // Upgrade for acl_version 3
377 $upgrade_acl = 3;
378 if ($acl_version < $upgrade_acl) {
379 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
381 //Collect the ACL ID numbers.
382 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
383 //Get Administrator ACL ID number
384 $admin_write = getAclIdNumber('Administrators', 'write');
385 //Get Emergency ACL ID number
386 $emergency_write = getAclIdNumber('Emergency Login', 'write');
388 //Add new object Sections
389 echo "<BR/><B>Adding new object sections</B><BR/>";
390 //Add 'Menus' object section (added in 4.1.3)
391 addObjectSectionAcl('menus', 'Menus');
393 //Add new Objects
394 echo "<BR/><B>Adding new objects</B><BR/>";
395 //Add 'modules' object (added in 4.1.3)
396 addObjectAcl('menus', 'Menus', 'modle', 'Modules');
398 //Update already existing Objects
399 echo "<BR/><B>Upgrading objects</B><BR/>";
401 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
402 // (will also place in the appropriate group and CREATE a new group if needed)
403 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
405 //Update the ACLs
406 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
407 //Insert the 'Modules' object from the 'Menus' section into the Administrators group write ACL (added in 4.1.3)
408 updateAcl($admin_write, 'Administrators','menus', 'Menus', 'modle', 'Modules', 'write');
409 //Insert the 'Modules' object from the 'Menus' section into the Emergency Login group write ACL (added in 4.1.3)
410 updateAcl($emergency_write, 'Emergency Login','menus', 'Menus', 'modle', 'Modules', 'write');
412 //DONE with upgrading to this version
413 $acl_version = $upgrade_acl;
416 /* This is a template for a new revision, when needed
417 // Upgrade for acl_version 4
418 $upgrade_acl = 4;
419 if ($acl_version < $upgrade_acl) {
420 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
422 //Collect the ACL ID numbers.
423 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
425 //Add new object Sections
426 echo "<BR/><B>Adding new object sections</B><BR/>";
428 //Add new Objects
429 echo "<BR/><B>Adding new objects</B><BR/>";
431 //Update already existing Objects
432 echo "<BR/><B>Upgrading objects</B><BR/>";
434 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
435 // (will also place in the appropriate group and CREATE a new group if needed)
436 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
438 //Update the ACLs
439 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
441 //DONE with upgrading to this version
442 $acl_version = $upgrade_acl;
446 //All done
447 $response = set_acl_version($acl_version);
449 if ($response) {
450 echo "DONE upgrading access controls";
451 } else {
452 echo "ERROR upgrading access control version";