Prevent No matching records from being clickable
[openemr.git] / acl_upgrade.php
blob1e48b0b34c9a93e87fe36a1c793f019e5c4125c1
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 * </pre>
90 * Copyright (C) 2012 Brady Miller <brady@sparmy.com>
92 * LICENSE: This program is free software; you can redistribute it and/or
93 * modify it under the terms of the GNU General Public License
94 * as published by the Free Software Foundation; either version 2
95 * of the License, or (at your option) any later version.
96 * This program is distributed in the hope that it will be useful,
97 * but WITHOUT ANY WARRANTY; without even the implied warranty of
98 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
99 * GNU General Public License for more details.
100 * You should have received a copy of the GNU General Public License
101 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>.
103 * @package OpenEMR
104 * @author Brady Miller <brady@sparmy.com>
105 * @link http://www.open-emr.org
108 $ignoreAuth = true; // no login required
110 require_once('interface/globals.php');
111 require_once("$srcdir/acl_upgrade_fx.php");
113 //Ensure that phpGACL has been installed
114 include_once('library/acl.inc');
115 if (isset ($phpgacl_location)) {
116 include_once("$phpgacl_location/gacl_api.class.php");
117 $gacl = new gacl_api();
119 else {
120 die("You must first set up library/acl.inc to use phpGACL!");
123 $acl_version = get_acl_version();
124 if (empty($acl_version)) {
125 $acl_version = 0;
128 // Upgrade for acl_version 1
129 $upgrade_acl = 1;
130 if ($acl_version < $upgrade_acl) {
131 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
133 //Collect the ACL ID numbers.
134 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
135 //Get Administrator ACL ID number
136 $admin_write = getAclIdNumber('Administrators', 'write');
137 //Get Doctor ACL ID Number
138 $doc_write = getAclIdNumber('Physicians', 'write');
139 //Get Clinician ACL with write access ID number
140 $clin_write = getAclIdNumber('Clinicians', 'write');
141 //Get Clinician ACL with addonly access ID number
142 $clin_addonly = getAclIdNumber('Clinicians', 'addonly');
143 //Get Receptionist ACL ID number
144 $front_write = getAclIdNumber('Front Office', 'write');
145 //Get Accountant ACL ID number
146 $back_write = getAclIdNumber('Accounting', 'write');
148 //Add new object Sections
149 echo "<BR/><B>Adding new object sections</B><BR/>";
150 //Add 'Sensitivities' object section (added in 2.8.2)
151 addObjectSectionAcl('sensitivities', 'Sensitivities');
152 //Add 'Lists' object section (added in 3.0.2)
153 addObjectSectionAcl('lists', 'Lists');
154 //Add 'Placeholder' object section (added in 3.0.2)
155 addObjectSectionAcl('placeholder', 'Placeholder');
156 //Add 'Nation Notes' object section (added in 4.1.0)
157 addObjectSectionAcl('nationnotes','Nation Notes');
158 //Add 'Patient Portal' object section (added in 4.1.0)
159 addObjectSectionAcl('patientportal', 'Patient Portal');
161 //Add new Objects
162 echo "<BR/><B>Adding new objects</B><BR/>";
163 //Add 'Normal' sensitivity object, order variable is default 10 (added in 2.8.2)
164 addObjectAcl('sensitivities', 'Sensitivities', 'normal', 'Normal');
165 //Add 'High' sensitivity object, order variable is set to 20 (added in 2.8.2)
166 addObjectAclWithOrder('sensitivities', 'Sensitivities', 'high', 'High', 20);
167 //Add 'Pharmacy Dispensary' object (added in 2.8.4)
168 addObjectAcl('admin', 'Administration', 'drugs', 'Pharmacy Dispensary');
169 //Add 'ACL Administration' object (added in 2.8.4)
170 addObjectAcl('admin', 'Administration', 'acl', 'ACL Administration');
171 //Add 'Price Discounting' object (added in 2.8.4)
172 addObjectAcl('acct', 'Accounting', 'disc', 'Price Discounting');
173 //Add 'Default List (write,addonly optional)' object (added in 3.0.2)
174 addObjectAcl('lists', 'Lists', 'default', 'Default List (write,addonly optional)');
175 //Add 'State List (write,addonly optional)' object (added in 3.0.2)
176 addObjectAcl('lists', 'Lists', 'state', 'State List (write,addonly optional)');
177 //Add 'Country List (write,addonly optional)' object (added in 3.0.2)
178 addObjectAcl('lists', 'Lists', 'country', 'Country List (write,addonly optional)');
179 //Add 'Language List (write,addonly optional)' object (added in 3.0.2)
180 addObjectAcl('lists', 'Lists', 'language', 'Language List (write,addonly optional)');
181 //Add 'Ethnicity-Race List (write,addonly optional)' object (added in 3.0.2)
182 addObjectAcl('lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)');
183 //Add 'Placeholder (Maintains empty ACLs)' object (added in 3.0.2)
184 addObjectAcl('placeholder', 'Placeholder', 'filler', 'Placeholder (Maintains empty ACLs)');
185 //Add 'Sign Lab Results (write,addonly optional)' object (added in 3.3.0)
186 addObjectAcl('patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)');
187 //Add 'nationnotes' object (added in 4.1.0)
188 addObjectAcl('nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure');
189 //Add 'patientportal' object (added in 4.1.0)
190 addObjectAcl('patientportal', 'Patient Portal', 'portal', 'Patient Portal');
192 //Update already existing Objects
193 echo "<BR/><B>Upgrading objects</B><BR/>";
194 //Ensure that 'High' sensitivity object order variable is set to 20
195 editObjectAcl('sensitivities', 'Sensitivities', 'high', 'High', 20);
197 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
198 // (will also place in the appropriate group and CREATE a new group if needed)
199 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
200 //Add 'Physicians' ACL with 'addonly' and collect the ID number (added in 3.0.2)
201 $doc_addonly = addNewACL('Physicians', 'doc', 'addonly', 'Things that physicians can read and enter but not modify');
202 //Add 'Front Office' ACL with 'addonly' and collect the ID number (added in 3.0.2)
203 $front_addonly = addNewACL('Front Office', 'front', 'addonly', 'Things that front office can read and enter but not modify');
204 //Add 'Accounting' ACL with 'addonly' and collect the ID number (added in 3.0.2)
205 $back_addonly = addNewACL('Accounting', 'back', 'addonly', 'Things that back office can read and enter but not modify');
206 //Add 'Emergency Login' ACL with 'write' and collect the ID number (added in 3.3.0)
207 $emergency_write = addNewACL('Emergency Login', 'breakglass', 'write', 'Things that can use for emergency login, can read and modify');
209 //Update the ACLs
210 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
211 //Insert the 'super' object from the 'admin' section into the Administrators group write ACL (added in 2.8.2)
212 updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'super', 'Superuser', 'write');
213 //Insert the 'high' object from the 'sensitivities' section into the Administrators group write ACL (added in 2.8.2)
214 updateAcl($admin_write, 'Administrators', 'sensitivities', 'Sensitivities', 'high', 'High', 'write');
215 //Insert the 'normal' object from the 'sensitivities' section into the Administrators group write ACL (added in 2.8.2)
216 updateAcl($admin_write, 'Administrators', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write');
217 //Insert the 'high' object from the 'sensitivities' section into the Physicians group write ACL (added in 2.8.2)
218 updateAcl($doc_write, 'Physicians', 'sensitivities', 'Sensitivities', 'high', 'High', 'write');
219 //Insert the 'normal' object from the 'sensitivities' section into the Physicians group write ACL (added in 2.8.2)
220 updateAcl($doc_write, 'Physicians', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write');
221 //Insert the 'normal' object from the 'sensitivities' section into the Clinicians group addonly ACL (added in 2.8.2)
222 updateAcl($clin_addonly, 'Clinicians', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'addonly');
223 //Insert the 'drugs' object from the 'admin' section into the Administrators group write ACL (added in 2.8.4)
224 updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
225 //Insert the 'drugs' object from the 'admin' section into the Physicians group write ACL (added in 2.8.4)
226 updateAcl($doc_write, 'Physicians', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
227 //Insert the 'drugs' object from the 'admin' section into the Clinicians group write ACL (added in 2.8.4)
228 updateAcl($clin_write, 'Clinicians', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
229 //Insert the 'acl' object from the 'admin' section into the Administrators group write ACL (added in 2.8.4)
230 updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'acl', 'ACL Administration', 'write');
231 //Insert the 'disc' object from the 'acct' section into the Administrators group write ACL (added in 2.8.4)
232 updateAcl($admin_write, 'Administrators', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
233 //Insert the 'disc' object from the 'acct' section into the Accounting group write ACL (added in 2.8.4)
234 updateAcl($back_write, 'Accounting', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
235 //Insert the 'disc' object from the 'acct' section into the Physicians group write ACL (added in 2.8.4)
236 updateAcl($doc_write, 'Physicians', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
237 //Insert the 'default' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
238 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'default', 'Default List (write,addonly optional)', 'write');
239 //Insert the 'state' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
240 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'state', 'State List (write,addonly optional)', 'write');
241 //Insert the 'country' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
242 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'country', 'Country List (write,addonly optional)', 'write');
243 //Insert the 'language' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
244 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'language', 'Language List (write,addonly optional)', 'write');
245 //Insert the 'race' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
246 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)', 'write');
247 //Update ACLs for Emergency Login
248 //Insert the 'disc' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
249 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
250 //Insert the 'bill' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
251 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'bill', 'Billing (write optional)', 'write');
252 //Insert the 'eob' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
253 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'eob', 'EOB Data Entry', 'write');
254 //Insert the 'rep' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
255 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'rep', 'Financial Reporting - my encounters', 'write');
256 //Insert the 'rep_a' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
257 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'rep_a', 'Financial Reporting - anything', 'write');
258 //Insert the 'calendar' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
259 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'calendar', 'Calendar Settings', 'write');
260 //Insert the 'database' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
261 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'database', 'Database Reporting', 'write');
262 //Insert the 'forms' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
263 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'forms', 'Forms Administration', 'write');
264 //Insert the 'practice' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
265 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'practice', 'Practice Settings', 'write');
266 //Insert the 'superbill' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
267 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'superbill', 'Superbill Codes Administration', 'write');
268 //Insert the 'users' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
269 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'users', 'Users/Groups/Logs Administration', 'write');
270 //Insert the 'batchcom' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
271 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'batchcom', 'Batch Communication Tool', 'write');
272 //Insert the 'language' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
273 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'language', 'Language Interface Tool', 'write');
274 //Insert the 'super' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
275 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'super', 'Superuser', 'write');
276 //Insert the 'drugs' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
277 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
278 //Insert the 'acl' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
279 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'acl', 'ACL Administration', 'write');
280 //Insert the 'auth_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
281 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'auth_a', 'Authorize - any encounters', 'write');
282 //Insert the 'coding_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
283 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'coding_a', 'Coding - any encounters (write,wsome optional)', 'write');
284 //Insert the 'notes_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
285 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'notes_a', 'Notes - any encounters (write,addonly optional)', 'write');
286 //Insert the 'date_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
287 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'date_a', 'Fix encounter dates - any encounters', 'write');
288 //Insert the 'default' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
289 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'default', 'Default List (write,addonly optional)', 'write');
290 //Insert the 'state' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
291 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'state', 'State List (write,addonly optional)', 'write');
292 //Insert the 'country' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
293 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'country', 'Country List (write,addonly optional)', 'write');
294 //Insert the 'language' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
295 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'language', 'Language List (write,addonly optional)', 'write');
296 //Insert the 'ethrace' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
297 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)', 'write');
298 //Insert the 'appt' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
299 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'appt', 'Appointments (write,wsome optional)', 'write');
300 //Insert the 'demo' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
301 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'demo', 'Demographics (write,addonly optional)', 'write');
302 //Insert the 'med' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
303 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'med', 'Medical/History (write,addonly optional)', 'write');
304 //Insert the 'trans' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
305 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'trans', 'Transactions (write optional)', 'write');
306 //Insert the 'docs' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
307 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'docs', 'Documents (write,addonly optional)', 'write');
308 //Insert the 'notes' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
309 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'notes', 'Patient Notes (write,addonly optional)', 'write');
310 //Insert the 'high' object from the 'sensitivities' section into the Emergency Login group write ACL (added in 3.3.0)
311 updateAcl($emergency_write, 'Emergency Login', 'sensitivities', 'Sensitivities', 'high', 'High', 'write');
312 //Insert the 'normal' object from the 'sensitivities' section into the Emergency Login group write ACL (added in 3.3.0)
313 updateAcl($emergency_write, 'Emergency Login', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write');
314 //Insert the 'sign' object from the 'patients' section into the Physicians group write ACL (added in 3.3.0)
315 updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)', 'write');
316 //Insert the 'sign' object from the 'nationnotes' section into the Administrators group write ACL (added in 3.3.0)
317 updateAcl($admin_write, 'Administrators','nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure','write');
318 //Insert the 'sign' object from the 'nationnotes' section into the Emergency Login group write ACL (added in 3.3.0)
319 updateAcl($emergency_write, 'Emergency Login','nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure','write');
320 //Insert the 'patientportal' object from the 'patientportal' section into the Administrators group write ACL (added in 4.1.0)
321 updateAcl($admin_write, 'Administrators','patientportal', 'Patient Portal', 'portal', 'Patient Portal','write');
322 //Insert the 'patientportal' object from the 'patientportal' section into the Emergency Login group write ACL (added in 4.1.0)
323 updateAcl($emergency_write, 'Emergency Login','patientportal', 'Patient Portal', 'portal', 'Patient Portal','write');
325 //DONE with upgrading to this version
326 $acl_version = $upgrade_acl;
329 // Upgrade for acl_version 2
330 $upgrade_acl = 2;
331 if ($acl_version < $upgrade_acl) {
332 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
334 //Collect the ACL ID numbers.
335 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
337 //Add new object Sections
338 echo "<BR/><B>Adding new object sections</B><BR/>";
340 //Add new Objects
341 echo "<BR/><B>Adding new objects</B><BR/>";
343 //Update already existing Objects
344 echo "<BR/><B>Upgrading objects</B><BR/>";
346 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
347 // (will also place in the appropriate group and CREATE a new group if needed)
348 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
349 addNewACL('Physicians', 'doc', 'wsome', 'Things that physicians can read and partly modify');
350 addNewACL('Clinicians', 'clin', 'wsome', 'Things that clinicians can read and partly modify');
351 addNewACL('Front Office', 'front', 'wsome', 'Things that front office can read and partly modify');
352 addNewACL('Accounting', 'back', 'wsome', 'Things that back office can read and partly modify');
353 addNewACL('Physicians', 'doc', 'view', 'Things that physicians can only read');
354 addNewACL('Clinicians', 'clin', 'view', 'Things that clinicians can only read');
355 addNewACL('Front Office', 'front', 'view', 'Things that front office can only read');
356 addNewACL('Accounting', 'back', 'view', 'Things that back office can only read');
358 //Update the ACLs
359 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
361 //DONE with upgrading to this version
362 $acl_version = $upgrade_acl;
365 /* This is a template for a new revision, when needed
366 // Upgrade for acl_version 3
367 $upgrade_acl = 3;
368 if ($acl_version < $upgrade_acl) {
369 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
371 //Collect the ACL ID numbers.
372 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
374 //Add new object Sections
375 echo "<BR/><B>Adding new object sections</B><BR/>";
377 //Add new Objects
378 echo "<BR/><B>Adding new objects</B><BR/>";
380 //Update already existing Objects
381 echo "<BR/><B>Upgrading objects</B><BR/>";
383 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
384 // (will also place in the appropriate group and CREATE a new group if needed)
385 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
387 //Update the ACLs
388 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
390 //DONE with upgrading to this version
391 $acl_version = $upgrade_acl;
395 /* This is a template for a new revision, when needed
396 // Upgrade for acl_version 4
397 $upgrade_acl = 4;
398 if ($acl_version < $upgrade_acl) {
399 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
401 //Collect the ACL ID numbers.
402 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
404 //Add new object Sections
405 echo "<BR/><B>Adding new object sections</B><BR/>";
407 //Add new Objects
408 echo "<BR/><B>Adding new objects</B><BR/>";
410 //Update already existing Objects
411 echo "<BR/><B>Upgrading objects</B><BR/>";
413 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
414 // (will also place in the appropriate group and CREATE a new group if needed)
415 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
417 //Update the ACLs
418 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
420 //DONE with upgrading to this version
421 $acl_version = $upgrade_acl;
425 //All done
426 set_acl_version($acl_version);
427 echo "DONE upgrading access controls";