Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/Scorpius-19.5.0' into Scorpius-1…
Browse files Browse the repository at this point in the history
…9.5.0
  • Loading branch information
TalDubovKaltura committed Mar 15, 2023
2 parents 29380b0 + a698e50 commit 9401da5
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deployment/permissions/service.session.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ permissionItem3.param3 =
permissionItem3.param4 =
permissionItem3.param5 =
permissionItem3.tags =
permissionItem3.permissions = ALWAYS_ALLOWED_ACTIONS, -2>PARTNER_-2_GROUP_*_PERMISSION, BASE_USER_SESSION_PERMISSION, WIDGET_SESSION_PERMISSION, -2>SYSTEM_ADMIN_BASE, -11>PARTNER_-11_GROUP_*_PERMISSION, -13>PARTNER_-13_GROUP_*_PERMISSION, -14>PARTNER_-14_GROUP_*_PERMISSION, -17>PARTNER_-17_GROUP_*_PERMISSION, -18>PARTNER_-18_GROUP_*_PERMISSION, -19>PARTNER_-19_GROUP_*_PERMISSION, -20>PARTNER_-20_GROUP_*_PERMISSION
permissionItem3.permissions = ALWAYS_ALLOWED_ACTIONS, -2>PARTNER_-2_GROUP_*_PERMISSION, BASE_USER_SESSION_PERMISSION, WIDGET_SESSION_PERMISSION, -2>SYSTEM_ADMIN_BASE, -11>PARTNER_-11_GROUP_*_PERMISSION, -13>PARTNER_-13_GROUP_*_PERMISSION, -14>PARTNER_-14_GROUP_*_PERMISSION, -16>PARTNER_-16_GROUP_*_PERMISSION, -17>PARTNER_-17_GROUP_*_PERMISSION, -18>PARTNER_-18_GROUP_*_PERMISSION, -19>PARTNER_-19_GROUP_*_PERMISSION, -20>PARTNER_-20_GROUP_*_PERMISSION

permissionItem4.service = session
permissionItem4.action = impersonatebyks
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
/**
* @package deployment
* @subpackage scorpius.roles_and_permissions
*/

$addPermissionsScript = realpath(dirname(__FILE__) . '/../../../../') . '/alpha/scripts/utils/permissions/addPermissionsAndItems.php';
$addConfig = realpath(dirname(__FILE__)) . '/../../../permissions/service.session.ini';
passthru("php $addPermissionsScript $addConfig");
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class CortexApiDistributionEngine extends DistributionEngine implements
IDistributionEngineSubmit,
IDistributionEngineDelete
{
protected $tempXmlPath;
const CORTEX_API_LOGIN = 'API/Authentication/v1.0/Login';
const CORTEX_API_SEND_METADATA = 'API/v2.2/DataTable/Documents.Video.General-Library-Video:Update';
const CORTEX_API_UPLOAD_NEW_MEDIA = 'API/UploadMedia/v3.0/UploadNewMedia';
Expand Down Expand Up @@ -34,6 +35,21 @@ class CortexApiDistributionEngine extends DistributionEngine implements
* @var string
*/
private $recordId;

public function configure()
{
if(KBatchBase::$taskConfig->params->tempXmlPath)
{
$this->tempXmlPath = KBatchBase::$taskConfig->params->tempXmlPath;
if(!kFile::isDir($this->tempXmlPath))
kFile::mkdir($this->tempXmlPath, 0777, true);
}
else
{
KalturaLog::err("params.tempXmlPath configuration not supplied");
$this->tempXmlPath = sys_get_temp_dir();
}
}
/**
* @param KalturaDistributionSubmitJobData $data
* @return bool
Expand Down Expand Up @@ -407,8 +423,45 @@ protected function uploadVideo(KalturaCortexApiDistributionJobProviderData $apiD
{
try
{
$SystemIdentifier = $this->mediaUpload($apiDistributionJobProviderData->videoAssetFilePath);
$needDel = false;
$videoFilePath = $apiDistributionJobProviderData->videoAssetFilePath;
if(!$videoFilePath)
{
throw new KalturaException('No video asset to distribute, the job will fail',KalturaBatchJobAppErrors::BULK_ITEM_NOT_FOUND);
}

if(!kFile::checkFileExists($videoFilePath))
{
throw new KalturaDistributionException('The file ['.$videoFilePath.'] was not found (probably not synced yet), the job will retry');
}
list($isRemote, $remoteUrl) = kFile::resolveFilePath($videoFilePath);
$tempVideoFilePath = !$isRemote ? null : kFile::getExternalFile($remoteUrl, null, basename($videoFilePath));

if(FALSE === strstr($videoFilePath, "."))
{
$videoFilePathNew = $this->tempXmlPath . "/" . uniqid() . ".dme";
if (!kFile::checkFileExists($videoFilePathNew))
{
$copyFrom = $tempVideoFilePath ? $tempVideoFilePath : $videoFilePath;
kFile::copy($copyFrom,$videoFilePathNew);
$needDel = true;
}
$videoFilePath = $videoFilePathNew;
}
elseif($isRemote)
{
$videoFilePath = $tempVideoFilePath;
}
$SystemIdentifier = $this->mediaUpload($videoFilePath);
KalturaLog::info("Cortex: upload video succeeded, SystemIdentifier: $SystemIdentifier");
if ($needDel == true)
{
kFile::unlink($videoFilePath);
}
if($isRemote)
{
kFile::unlink($tempVideoFilePath);
}
$this->setCortexSystemId($SystemIdentifier);
return true;
}
Expand Down
9 changes: 9 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Scorpius-19.5.0
## Add Permissions to Gaming-Services Partner ##
Add permissions to Gaming-Services partner to start session

* Issue Type: Task
* Issue ID: PLAT-24195

#### Deployment Script ####
php /opt/kaltura/app/deployment/updates/scripts/add_permissions/2023_03_14_update_gaming_partner_impersonate_permission.php

## Support for clearing the Recycle Bin ##
- Issue Type: Story
- Issue ID: PLAT-24171
Expand Down

0 comments on commit 9401da5

Please sign in to comment.