Adding the permissions addNewObjectPermissions method
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user