Ejemplo n.º 1
0
function addBundleRights($bundleDefinition, $aclProvider, $securityIdentity, $application)
{
    if (!array_key_exists('resources', $bundleDefinition) || !array_key_exists('actions', $bundleDefinition)) {
        return;
    }
    $actions = getActions($bundleDefinition['actions']);
    if (0 === count($actions)) {
        return [];
    }
    if (is_array($bundleDefinition['resources'])) {
        foreach ($bundleDefinition['resources'] as $bundleName) {
            if (null !== ($bundle = $application->getBundle($bundleName))) {
                addObjectAcl($bundle, $aclProvider, $securityIdentity, $actions);
            }
        }
    } elseif ('all' === $bundleDefinition['resources']) {
        foreach ($application->getBundles() as $bundle) {
            addObjectAcl($bundle, $aclProvider, $securityIdentity, $actions);
        }
    }
}
Ejemplo n.º 2
0
//Add 'State List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'state', 'State List (write,addonly optional)');
//Add 'Country List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'country', 'Country List (write,addonly optional)');
//Add 'Language List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'language', 'Language List (write,addonly optional)');
//Add 'Ethnicity-Race List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)');
//Add 'Placeholder (Maintains empty ACLs)' object (added in 3.0.2)
addObjectAcl('placeholder', 'Placeholder', 'filler', 'Placeholder (Maintains empty ACLs)');
//Add 'Sign Lab Results (write,addonly optional)' object (added in 3.3.0)
addObjectAcl('patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)');
//Add 'nationnotes' object (added in 4.1.0)
addObjectAcl('nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure');
//Add 'patientportal' object (added in 4.1.0)
addObjectAcl('patientportal', 'Patient Portal', 'portal', 'Patient Portal');
//Update already existing Objects
echo "<BR/><B>Upgrading objects</B><BR/>";
//Ensure that 'High' sensitivity object order variable is set to 20
editObjectAcl('sensitivities', 'Sensitivities', 'high', 'High', 20);
//Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
// (will also place in the appropriate group and CREATE a new group if needed)
echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
//Add 'Physicians' ACL with 'addonly' and collect the ID number (added in 3.0.2)
$doc_addonly = addNewACL('Physicians', 'doc', 'addonly', 'Things that physicians can read and enter but not modify');
//Add 'Front Office' ACL with 'addonly' and collect the ID number (added in 3.0.2)
$front_addonly = addNewACL('Front Office', 'front', 'addonly', 'Things that front office can read and enter but not modify');
//Add 'Accounting' ACL with 'addonly' and collect the ID number (added in 3.0.2)
$back_addonly = addNewACL('Accounting', 'back', 'addonly', 'Things that back office can read and enter but not modify');
//Add 'Emergency Login' ACL with 'write' and collect the ID number (added in 3.3.0)
$emergency_write = addNewACL('Emergency Login', 'breakglass', 'write', 'Things that can use for emergency login, can read and modify');
Ejemplo n.º 3
0
//Add 'Price Discounting' object (added in 2.8.4)
addObjectAcl('acct', 'Accounting', 'disc', 'Price Discounting');
//Add 'Default List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'default', 'Default List (write,addonly optional)');
//Add 'State List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'state', 'State List (write,addonly optional)');
//Add 'Country List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'country', 'Country List (write,addonly optional)');
//Add 'Language List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'language', 'Language List (write,addonly optional)');
//Add 'Ethnicity-Race List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)');
//Add 'Placeholder (Maintains empty ACLs)' object (added in 3.0.2)
addObjectAcl('placeholder', 'Placeholder', 'filler', 'Placeholder (Maintains empty ACLs)');
//Add 'Sign Lab Results (write,addonly optional)' object (added in 3.3.0)
addObjectAcl('patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)');
//Update already existing Objects
echo "<BR/><B>Upgrading objects</B><BR/>";
//Ensure that 'High' sensitivity object order variable is set to 20
editObjectAcl('sensitivities', 'Sensitivities', 'high', 'High', 20);
//Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
// (will also place in the appropriate group and CREATE a new group if needed)
echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
//Add 'Physicians' ACL with 'addonly' and collect the ID number (added in 3.0.2)
$doc_addonly = addNewACL('Physicians', 'doc', 'addonly', 'Things that physicians can read and enter but not modify');
//Add 'Front Office' ACL with 'addonly' and collect the ID number (added in 3.0.2)
$front_addonly = addNewACL('Front Office', 'front', 'addonly', 'Things that front office can read and enter but not modify');
//Add 'Accounting' ACL with 'addonly' and collect the ID number (added in 3.0.2)
$back_addonly = addNewACL('Accounting', 'back', 'addonly', 'Things that back office can read and enter but not modify');
//Add 'Emergency Login' ACL with 'write' and collect the ID number (added in 3.3.0)
$emergency_write = addNewACL('Emergency Login', 'breakglass', 'write', 'Things that can use for emergency login, can read and modify');
Ejemplo n.º 4
0
if ($acl_version < $upgrade_acl) {
    echo "<B>UPGRADING ACCESS CONTROLS TO VERSION " . $upgrade_acl . ":</B></BR>";
    //Collect the ACL ID numbers.
    echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
    //Get Administrator ACL ID number
    $admin_write = getAclIdNumber('Administrators', 'write');
    //Get Emergency ACL ID number
    $emergency_write = getAclIdNumber('Emergency Login', 'write');
    //Add new object Sections
    echo "<BR/><B>Adding new object sections</B><BR/>";
    //Add 'Menus' object section (added in 4.1.3)
    addObjectSectionAcl('menus', 'Menus');
    //Add new Objects
    echo "<BR/><B>Adding new objects</B><BR/>";
    //Add 'modules' object (added in 4.1.3)
    addObjectAcl('menus', 'Menus', 'modle', 'Modules');
    //Update already existing Objects
    echo "<BR/><B>Upgrading objects</B><BR/>";
    //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
    // (will also place in the appropriate group and CREATE a new group if needed)
    echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
    //Update the ACLs
    echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
    //Insert the 'Modules' object from the 'Menus' section into the Administrators group write ACL (added in 4.1.3)
    updateAcl($admin_write, 'Administrators', 'menus', 'Menus', 'modle', 'Modules', 'write');
    //Insert the 'Modules' object from the 'Menus' section into the Emergency Login group write ACL (added in 4.1.3)
    updateAcl($emergency_write, 'Emergency Login', 'menus', 'Menus', 'modle', 'Modules', 'write');
    //DONE with upgrading to this version
    $acl_version = $upgrade_acl;
}
/* This is a template for a new revision, when needed
Ejemplo n.º 5
0
 /**
  * this will be used to register a module 
  * @param unknown_type $directory
  * @param unknown_type $rel_path
  * @param unknown_type $state
  * @param unknown_type $base
  * @return boolean
  */
 public function register($directory, $rel_path, $state = 0, $base = "custom_modules")
 {
     /*$check = sqlQuery("select mod_active from modules where mod_directory='$directory'");*/
     $sql = "SELECT mod_active FROM modules WHERE mod_directory = ?";
     $params = array($directory);
     $check = $this->applicationTable->sqlQuery($sql, $params);
     if ($check->count() == 0) {
         $added = "";
         $typeSet = "";
         if ($base != "custom_modules") {
             $added = "module/";
             $typeSet = "type=1,";
         }
         $lines = @file($GLOBALS['srcdir'] . "/../interface/modules/{$base}/{$added}{$directory}/info.txt");
         if ($lines) {
             $name = $lines[0];
         } else {
             $name = $directory;
         }
         $uiname = ucwords(strtolower($directory));
         $sql = "INSERT INTO modules SET mod_name = ?,\n                                                mod_active = ?, \n                                                mod_ui_name = ?, \n                                                mod_relative_link = ?,\n                                                {$typeSet} \n                                                mod_directory = ?, \n                                                date=NOW()\n                                                ";
         $params = array($name, $state, $uiname, strtolower($rel_path), mysql_escape_string($directory));
         $result = $this->applicationTable->sqlQuery($sql, $params);
         $moduleInsertId = $result->getGeneratedValue();
         /*$moduleInsertId = sqlInsert("insert into modules set
           				mod_name='$name',
           				mod_active='$state',
           				mod_ui_name= '$uiname',
           				mod_relative_link= '" . strtolower($rel_path) . "',".$typeSet."
         		mod_directory='".mysql_escape_string($directory)."',
         		date=NOW()
         		");*/
         if (file_exists($GLOBALS['srcdir'] . "/../interface/modules/{$base}/{$added}{$directory}/moduleSettings.php")) {
             $ModuleObject = 'modules_' . strtolower($directory);
             $ModuleObjectTitle = 'Module ' . ucwords($directory);
             global $MODULESETTINGS;
             include_once $GLOBALS['srcdir'] . "/../interface/modules/{$base}/{$added}{$directory}/moduleSettings.php";
             foreach ($MODULESETTINGS as $Settings => $SettingsArray) {
                 if ($Settings == 'ACL') {
                     $SettingsVal = 1;
                 } elseif ($Settings == 'preferences') {
                     $SettingsVal = 2;
                 } else {
                     $SettingsVal = 3;
                 }
                 $i = 0;
                 foreach ($SettingsArray as $k => $v) {
                     if ($SettingsVal == 1) {
                         if ($i == 0) {
                             addObjectSectionAcl($ModuleObject, $ModuleObjectTitle);
                         }
                         addObjectAcl($ModuleObject, $ModuleObjectTitle, $k, $v['menu_name']);
                         $i++;
                     }
                     /*sqlStatement("INSERT INTO modules_settings VALUES (?,?,?,?,?)",array($moduleInsertId,$SettingsVal,$k,$v['menu_name'],$v['[path']));*/
                     $sql = "INSERT INTO modules_settings VALUES (?,?,?,?,?)";
                     $params = array($moduleInsertId, $SettingsVal, $k, $v['menu_name'], $v['[path']);
                     $result = $this->applicationTable->sqlQuery($sql, $params);
                 }
             }
         }
         /*sqlStatement("INSERT INTO module_acl_sections VALUES (?,?,?,?)",array($moduleInsertId,$name,0,strtolower($directory)));*/
         $sql = "INSERT INTO module_acl_sections VALUES (?,?,?,?,?)";
         $params = array($moduleInsertId, $name, 0, strtolower($directory), $moduleInsertId);
         $result = $this->applicationTable->sqlQuery($sql, $params);
         return $moduleInsertId;
     }
     return false;
 }
Ejemplo n.º 6
0
//Add 'Default List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'default', 'Default List (write,addonly optional)');
//Add 'State List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'state', 'State List (write,addonly optional)');
//Add 'Country List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'country', 'Country List (write,addonly optional)');
//Add 'Language List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'language', 'Language List (write,addonly optional)');
//Add 'Ethnicity-Race List (write,addonly optional)' object (added in 3.0.2)
addObjectAcl('lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)');
//Add 'Placeholder (Maintains empty ACLs)' object (added in 3.0.2)
addObjectAcl('placeholder', 'Placeholder', 'filler', 'Placeholder (Maintains empty ACLs)');
//Add 'Sign Lab Results (write,addonly optional)' object (added in 3.3.0)
addObjectAcl('patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)');
//Add 'nationnotes' object (added in 4.1.0)
addObjectAcl('nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure');
//Update already existing Objects
echo "<BR/><B>Upgrading objects</B><BR/>";
//Ensure that 'High' sensitivity object order variable is set to 20
editObjectAcl('sensitivities', 'Sensitivities', 'high', 'High', 20);
//Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
// (will also place in the appropriate group and CREATE a new group if needed)
echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
//Add 'Physicians' ACL with 'addonly' and collect the ID number (added in 3.0.2)
$doc_addonly = addNewACL('Physicians', 'doc', 'addonly', 'Things that physicians can read and enter but not modify');
//Add 'Front Office' ACL with 'addonly' and collect the ID number (added in 3.0.2)
$front_addonly = addNewACL('Front Office', 'front', 'addonly', 'Things that front office can read and enter but not modify');
//Add 'Accounting' ACL with 'addonly' and collect the ID number (added in 3.0.2)
$back_addonly = addNewACL('Accounting', 'back', 'addonly', 'Things that back office can read and enter but not modify');
//Add 'Emergency Login' ACL with 'write' and collect the ID number (added in 3.3.0)
$emergency_write = addNewACL('Emergency Login', 'breakglass', 'write', 'Things that can use for emergency login, can read and modify');