本文整理匯總了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;
}