當前位置: 首頁>>代碼示例>>PHP>>正文


PHP entry::getAccessControl方法代碼示例

本文整理匯總了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);
             }
         }
     }
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:28,代碼來源:KSecureEntryHelper.class.php

示例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);
         }
     }
 }
開發者ID:richhl,項目名稱:kalturaCE,代碼行數:11,代碼來源:KSecureEntryHelper.class.php

示例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);
             }
         }
     }
 }
開發者ID:dozernz,項目名稱:server,代碼行數:24,代碼來源:KSecureEntryHelper.class.php

示例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);
     }
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:24,代碼來源:kContextDataHelper.php

示例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;
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:23,代碼來源:DrmPlugin.php


注:本文中的entry::getAccessControl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。