Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLAT-9256: we should cache thumbnail for non block and limit thumbnai… #7646

Merged
merged 5 commits into from Oct 9, 2018

Conversation

noam-arad
Copy link
Contributor

…l capture access control actions

@@ -102,13 +102,22 @@ public function __construct(entry $entry, $ksStr, $referrer, $contexts = array()
$this->applyContext();
}

public function hasRules($contextType = null)
public function hasRules($contextType = null, $actionTypes = null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you passing action type as array while its content is not referred (it is type boolean)?

@@ -297,7 +297,11 @@ public function execute()
$referrer = kApiCache::getHttpReferrer();
$ksStr = $this->getRequestParameter("ks");
$secureEntryHelper = new KSecureEntryHelper($entry, $ksStr, $referrer, ContextType::THUMBNAIL);
$secureEntryHelper->validateForPlay();
$enableCacheValidation = $secureEntryHelper->hasRules(ContextType::THUMBNAIL, array(RuleActionType::BLOCK,RuleActionType::LIMIT_THUMBNAIL_CAPTURE));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This array here is useless.

@@ -453,8 +457,8 @@ public function execute()
}

$nocache = false;
if ($secureEntryHelper->shouldDisableCache() || kApiCache::hasExtraFields() ||
(!$secureEntryHelper->isKsWidget() && $secureEntryHelper->hasRules(ContextType::THUMBNAIL)))
if ($enableCacheValidation && ($secureEntryHelper->shouldDisableCache() || kApiCache::hasExtraFields() ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be optimized ->
$nocache = $enableCacheValidation && ($secureEntryHelper->shouldDisableCache() || kApiCache::hasExtraFields() || !$secureEntryHelper->isKsWidget() && $secureEntryHelper->hasRules(ContextType::THUMBNAIL));

@MosheMaorKaltura
Copy link
Contributor

reviewed

@noam-arad noam-arad merged commit 9f584b2 into Naos-14.6.0 Oct 9, 2018
@noam-arad noam-arad deleted the Naos-14.6.0-PLAT-9256_1 branch October 9, 2018 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants