Exemplo n.º 1
0
 public function initService($serviceId, $serviceName, $actionName)
 {
     parent::initService($serviceId, $serviceName, $actionName);
     $this->applyPartnerFilterForClass('CuePoint');
     // when session is not admin, allow access to user entries only
     if (!$this->getKs() || !$this->getKs()->isAdmin()) {
         KalturaCriterion::enableTag(KalturaCriterion::TAG_USER_SESSION);
         CuePointPeer::setUserContentOnly(true);
     }
     if (!CuePointPlugin::isAllowedPartner($this->getPartnerId())) {
         throw new KalturaAPIException(KalturaErrors::FEATURE_FORBIDDEN, CuePointPlugin::PLUGIN_NAME);
     }
     if (!$this->getPartner()->getEnabledService(PermissionName::FEATURE_KALTURA_LIVE_STREAM)) {
         throw new KalturaAPIException(KalturaErrors::FEATURE_FORBIDDEN, 'Kaltura Live Streams');
     }
 }
Exemplo n.º 2
0
 public function initService($serviceId, $serviceName, $actionName)
 {
     parent::initService($serviceId, $serviceName, $actionName);
     // Play-Server and Media-Server list entries of all partners
     // This is not too expensive as the requests are cached conditionally and performed on sphinx
     $allowedSystemPartners = array(Partner::MEDIA_SERVER_PARTNER_ID, Partner::PLAY_SERVER_PARTNER_ID);
     if (in_array($this->getPartnerId(), $allowedSystemPartners) && $actionName == 'list') {
         myPartnerUtils::resetPartnerFilter('entry');
     } else {
         $this->applyPartnerFilterForClass('CuePoint');
     }
     // when session is not admin, allow access to user entries only
     if (!$this->getKs() || !$this->getKs()->isAdmin()) {
         KalturaCriterion::enableTag(KalturaCriterion::TAG_USER_SESSION);
         CuePointPeer::setUserContentOnly(true);
     }
     if (!CuePointPlugin::isAllowedPartner($this->getPartnerId())) {
         throw new KalturaAPIException(KalturaErrors::FEATURE_FORBIDDEN, CuePointPlugin::PLUGIN_NAME);
     }
 }