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
Conversation
…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) |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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() || |
There was a problem hiding this comment.
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));
reviewed |
…Naos-14.6.0-PLAT-9256_1
…l capture access control actions