Skip to content

Commit 9401da5

Browse files
Merge remote-tracking branch 'origin/Scorpius-19.5.0' into Scorpius-19.5.0
2 parents 29380b0 + a698e50 commit 9401da5

File tree

4 files changed

+73
-2
lines changed

4 files changed

+73
-2
lines changed

deployment/permissions/service.session.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ permissionItem3.param3 =
2424
permissionItem3.param4 =
2525
permissionItem3.param5 =
2626
permissionItem3.tags =
27-
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
27+
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
2828

2929
permissionItem4.service = session
3030
permissionItem4.action = impersonatebyks
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
/**
3+
* @package deployment
4+
* @subpackage scorpius.roles_and_permissions
5+
*/
6+
7+
$addPermissionsScript = realpath(dirname(__FILE__) . '/../../../../') . '/alpha/scripts/utils/permissions/addPermissionsAndItems.php';
8+
$addConfig = realpath(dirname(__FILE__)) . '/../../../permissions/service.session.ini';
9+
passthru("php $addPermissionsScript $addConfig");

plugins/content_distribution/providers/cortex/lib/CortexApiDistributionEngine.php

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class CortexApiDistributionEngine extends DistributionEngine implements
77
IDistributionEngineSubmit,
88
IDistributionEngineDelete
99
{
10+
protected $tempXmlPath;
1011
const CORTEX_API_LOGIN = 'API/Authentication/v1.0/Login';
1112
const CORTEX_API_SEND_METADATA = 'API/v2.2/DataTable/Documents.Video.General-Library-Video:Update';
1213
const CORTEX_API_UPLOAD_NEW_MEDIA = 'API/UploadMedia/v3.0/UploadNewMedia';
@@ -34,6 +35,21 @@ class CortexApiDistributionEngine extends DistributionEngine implements
3435
* @var string
3536
*/
3637
private $recordId;
38+
39+
public function configure()
40+
{
41+
if(KBatchBase::$taskConfig->params->tempXmlPath)
42+
{
43+
$this->tempXmlPath = KBatchBase::$taskConfig->params->tempXmlPath;
44+
if(!kFile::isDir($this->tempXmlPath))
45+
kFile::mkdir($this->tempXmlPath, 0777, true);
46+
}
47+
else
48+
{
49+
KalturaLog::err("params.tempXmlPath configuration not supplied");
50+
$this->tempXmlPath = sys_get_temp_dir();
51+
}
52+
}
3753
/**
3854
* @param KalturaDistributionSubmitJobData $data
3955
* @return bool
@@ -407,8 +423,45 @@ protected function uploadVideo(KalturaCortexApiDistributionJobProviderData $apiD
407423
{
408424
try
409425
{
410-
$SystemIdentifier = $this->mediaUpload($apiDistributionJobProviderData->videoAssetFilePath);
426+
$needDel = false;
427+
$videoFilePath = $apiDistributionJobProviderData->videoAssetFilePath;
428+
if(!$videoFilePath)
429+
{
430+
throw new KalturaException('No video asset to distribute, the job will fail',KalturaBatchJobAppErrors::BULK_ITEM_NOT_FOUND);
431+
}
432+
433+
if(!kFile::checkFileExists($videoFilePath))
434+
{
435+
throw new KalturaDistributionException('The file ['.$videoFilePath.'] was not found (probably not synced yet), the job will retry');
436+
}
437+
list($isRemote, $remoteUrl) = kFile::resolveFilePath($videoFilePath);
438+
$tempVideoFilePath = !$isRemote ? null : kFile::getExternalFile($remoteUrl, null, basename($videoFilePath));
439+
440+
if(FALSE === strstr($videoFilePath, "."))
441+
{
442+
$videoFilePathNew = $this->tempXmlPath . "/" . uniqid() . ".dme";
443+
if (!kFile::checkFileExists($videoFilePathNew))
444+
{
445+
$copyFrom = $tempVideoFilePath ? $tempVideoFilePath : $videoFilePath;
446+
kFile::copy($copyFrom,$videoFilePathNew);
447+
$needDel = true;
448+
}
449+
$videoFilePath = $videoFilePathNew;
450+
}
451+
elseif($isRemote)
452+
{
453+
$videoFilePath = $tempVideoFilePath;
454+
}
455+
$SystemIdentifier = $this->mediaUpload($videoFilePath);
411456
KalturaLog::info("Cortex: upload video succeeded, SystemIdentifier: $SystemIdentifier");
457+
if ($needDel == true)
458+
{
459+
kFile::unlink($videoFilePath);
460+
}
461+
if($isRemote)
462+
{
463+
kFile::unlink($tempVideoFilePath);
464+
}
412465
$this->setCortexSystemId($SystemIdentifier);
413466
return true;
414467
}

release-notes.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# Scorpius-19.5.0
2+
## Add Permissions to Gaming-Services Partner ##
3+
Add permissions to Gaming-Services partner to start session
4+
5+
* Issue Type: Task
6+
* Issue ID: PLAT-24195
7+
8+
#### Deployment Script ####
9+
php /opt/kaltura/app/deployment/updates/scripts/add_permissions/2023_03_14_update_gaming_partner_impersonate_permission.php
10+
211
## Support for clearing the Recycle Bin ##
312
- Issue Type: Story
413
- Issue ID: PLAT-24171

0 commit comments

Comments
 (0)