本文整理汇总了PHP中entry::getAccessControl方法的典型用法代码示例。如果您正苦于以下问题:PHP entry::getAccessControl方法的具体用法?PHP entry::getAccessControl怎么用?PHP entry::getAccessControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entry
的用法示例。
在下文中一共展示了entry::getAccessControl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validateAccessControl
public function validateAccessControl()
{
$accessControl = $this->entry->getAccessControl();
if (!$accessControl) {
return;
}
$context = new kEntryContextDataResult();
$scope = $this->getAccessControlScope();
if (!$this->isKsAdmin()) {
$this->disableCache = $accessControl->applyContext($context, $scope);
} else {
$this->disableCache = false;
}
if (count($context->getAccessControlMessages())) {
foreach ($context->getAccessControlMessages() as $msg) {
header("X-Kaltura: access-control: {$msg}");
}
}
if (count($context->getAccessControlActions())) {
$actions = $context->getAccessControlActions();
foreach ($actions as $action) {
/* @var $action kAccessControlAction */
if ($action->getType() == accessControlActionType::BLOCK) {
KExternalErrors::dieError(KExternalErrors::ACCESS_CONTROL_RESTRICTED);
}
}
}
}
示例2: validateAccessControl
protected function validateAccessControl()
{
$accessControl = $this->_entry->getAccessControl();
if ($accessControl) {
$accessControlScope = $this->getAccessControlScope();
$accessControl->setScope($accessControlScope);
if (!$accessControl->isValid()) {
KExternalErrors::dieError(KExternalErrors::ACCESS_CONTROL_RESTRICTED);
}
}
}
示例3: applyContext
protected function applyContext()
{
$this->contextResult = null;
$accessControl = $this->entry->getAccessControl();
if (!$accessControl) {
return;
}
$this->contextResult = new kEntryContextDataResult();
$scope = $this->getAccessControlScope();
if (!$this->isKsAdmin()) {
$this->disableCache = $accessControl->applyContext($this->contextResult, $scope);
} else {
$this->disableCache = false;
}
if (count($this->contextResult->getActions())) {
foreach ($this->contextResult->getActions() as $action) {
if (!isset($this->actionLists[$action->getType()])) {
$this->actionLists[$action->getType()] = array($action);
} else {
array_push($this->actionLists[$action->getType()], $action);
}
}
}
}
示例4: applyAccessControlOnContextData
private function applyAccessControlOnContextData(accessControlScope $accessControlScope)
{
if ($this->isAdmin) {
return;
}
$accessControl = $this->entry->getAccessControl();
/* @var $accessControl accessControl */
if ($accessControl && $accessControl->hasRules()) {
$this->isSecured = true;
if (kConf::hasMap("optimized_playback")) {
$partnerId = $accessControl->getPartnerId();
$optimizedPlayback = kConf::getMap("optimized_playback");
if (array_key_exists($partnerId, $optimizedPlayback)) {
$params = $optimizedPlayback[$partnerId];
if (array_key_exists('cache_kdp_access_control', $params) && $params['cache_kdp_access_control'] && (strpos(strtolower(kCurrentContext::$client_lang), "kdp") !== false || strpos(strtolower(kCurrentContext::$client_lang), "html") !== false)) {
return;
}
}
}
$accessControlScope->setEntryId($this->entry->getId());
$this->isAdmin = $accessControlScope->getKs() && $accessControlScope->getKs()->isAdmin();
$this->disableCache = $accessControl->applyContext($this->contextDataResult);
}
}
示例5: shouldContribute
/**
* @param entry $entry
* @return bool
*/
protected function shouldContribute(entry $entry)
{
if ($entry->getAccessControl()) {
foreach ($entry->getAccessControl()->getRulesArray() as $rule) {
/**
* @var kRule $rule
*/
foreach ($rule->getActions() as $action) {
/**
* @var kRuleAction $action
*/
if ($action->getType() == DrmAccessControlActionType::DRM_POLICY) {
return true;
}
}
}
}
return false;
}