BUG-9981: En el servidor de Telefonica, no se visualizan todos los... SOLVED
- No se realizaba la verificacion en la tabla PERMISSIONS de la base de datos RBAC al realizar upgrade. - Se agrega la funcion verifyPermissions en la clase rbac.php la cual verifica los permisos, realizando los insert de los permisos que faltaran de acuerdo a la funcion loadPermissionAdmin, al realizar el upgrade.
This commit is contained in:
@@ -1170,5 +1170,44 @@ class RBAC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* this function permissions
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function verifyPermissions ()
|
||||||
|
{
|
||||||
|
$message = array();
|
||||||
|
$listPermissions = $this->loadPermissionAdmin();
|
||||||
|
$criteria = new Criteria( 'rbac' );
|
||||||
|
$dataset = PermissionsPeer::doSelectRS( $criteria );
|
||||||
|
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
|
$dataset->next();
|
||||||
|
$aRow = $dataset->getRow();
|
||||||
|
while (is_array( $aRow )) {
|
||||||
|
foreach($listPermissions as $key => $item) {
|
||||||
|
if ($aRow['PER_UID'] == $item['PER_UID'] ) {
|
||||||
|
unset($listPermissions[$key]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$dataset->next();
|
||||||
|
$aRow = $dataset->getRow();
|
||||||
|
}
|
||||||
|
foreach($listPermissions as $key => $item) {
|
||||||
|
$data['PER_UID'] = $item['PER_UID'];
|
||||||
|
$data['PER_CODE'] = $item['PER_CODE'];
|
||||||
|
$data['PER_CREATE_DATE'] = date('Y-m-d H:i:s');
|
||||||
|
$data['PER_UPDATE_DATE'] = $data['PER_CREATE_DATE'];
|
||||||
|
$data['PER_STATUS'] = 1;
|
||||||
|
$permission = new Permissions();
|
||||||
|
$permission->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||||
|
$iResult = $permission->save();
|
||||||
|
$message[] = 'Add permission ' . $item['PER_CODE'];
|
||||||
|
}
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
G::LoadSystem('dbMaintenance');
|
G::LoadSystem('dbMaintenance');
|
||||||
G::LoadClass("cli");
|
G::LoadClass("cli");
|
||||||
G::LoadClass("multipleFilesBackup");
|
G::LoadClass("multipleFilesBackup");
|
||||||
|
G::LoadSystem('rbac' );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class workspaceTools
|
* class workspaceTools
|
||||||
@@ -89,7 +90,7 @@ class workspaceTools
|
|||||||
$stop = microtime(true);
|
$stop = microtime(true);
|
||||||
$final = $stop - $start;
|
$final = $stop - $start;
|
||||||
CLI::logging("<*> Updating cache view Process took $final seconds.\n");
|
CLI::logging("<*> Updating cache view Process took $final seconds.\n");
|
||||||
|
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
CLI::logging("> Updating cases directories structure...\n");
|
CLI::logging("> Updating cases directories structure...\n");
|
||||||
$this->upgradeCasesDirectoryStructure($workSpace);
|
$this->upgradeCasesDirectoryStructure($workSpace);
|
||||||
@@ -460,6 +461,20 @@ class workspaceTools
|
|||||||
//Update APP_DELEGATION.DEL_LAST_INDEX data
|
//Update APP_DELEGATION.DEL_LAST_INDEX data
|
||||||
$res = $appCache->updateAppDelegationDelLastIndex($lang, $checkOnly);
|
$res = $appCache->updateAppDelegationDelLastIndex($lang, $checkOnly);
|
||||||
|
|
||||||
|
CLI::logging("-> Update table RBAC Permissions... \n");
|
||||||
|
//Update table RBAC permissions
|
||||||
|
Bootstrap::LoadSystem( 'rbac' );
|
||||||
|
$RBAC = & RBAC::getSingleton();
|
||||||
|
$RBAC->initRBAC();
|
||||||
|
$resutl = $RBAC->verifyPermissions();
|
||||||
|
if (count($resutl) > 1) {
|
||||||
|
foreach($resutl as $item) {
|
||||||
|
CLI::logging(" $item... \n");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
CLI::logging(" No Changes... \n");
|
||||||
|
}
|
||||||
|
|
||||||
CLI::logging("-> Creating triggers\n");
|
CLI::logging("-> Creating triggers\n");
|
||||||
//now check if we have the triggers installed
|
//now check if we have the triggers installed
|
||||||
$triggers = array();
|
$triggers = array();
|
||||||
|
|||||||
Reference in New Issue
Block a user