Adding the permissions addNewObjectPermissions method

This commit is contained in:
Gustavo Adolfo Cruz Laura
2016-03-28 17:26:29 -04:00
parent 9f922f680f
commit ea9ed0b448
2 changed files with 20 additions and 1 deletions

View File

@@ -2833,6 +2833,25 @@ class Processes
}
/**
* @param $aPermission
* @throws Exception
*/
public function addNewObjectPermissionRows($aPermission)
{
try {
$oPermission = new ObjectPermission();
foreach ($aPermission as $key => $row) {
if (!$oPermission->Exists($row['OP_UID'])) {
$oPermission->create($row);
}
}
} catch (Exception $e) {
throw $e;
}
}
/**
* Get Object Permission Rows from a Process
*

View File

@@ -30,7 +30,7 @@ class PermissionsMigrator implements Importable, Exportable
if ($replace) {
$this->processes->createObjectPermissionsRows($data);
} else {
$this->processes->updateObjectPermissionRows($data);
$this->processes->addNewObjectPermissionRows($data);
}
} catch (\Exception $e) {
\Logger::log($e->getMessage());