Exemplo n.º 1
0
 public function initService($serviceId, $serviceName, $actionName)
 {
     $ks = kCurrentContext::$ks_object ? kCurrentContext::$ks_object : null;
     if ($actionName == 'search' && (!$ks || !$ks->isAdmin() && !$ks->verifyPrivileges(ks::PRIVILEGE_LIST, ks::PRIVILEGE_WILDCARD))) {
         KalturaCriterion::enableTag(KalturaCriterion::TAG_WIDGET_SESSION);
         entryPeer::setUserContentOnly(true);
     }
     parent::initService($serviceId, $serviceName, $actionName);
     if ($actionName != 'parse') {
         $this->applyPartnerFilterForClass('asset');
         $this->applyPartnerFilterForClass('CaptionAssetItem');
     }
     if (!CaptionSearchPlugin::isAllowedPartner($this->getPartnerId())) {
         throw new KalturaAPIException(KalturaErrors::FEATURE_FORBIDDEN, CaptionSearchPlugin::PLUGIN_NAME);
     }
 }
Exemplo n.º 2
0
 public function initService($serviceId, $serviceName, $actionName)
 {
     $ks = kCurrentContext::$ks_object ? kCurrentContext::$ks_object : null;
     if (($actionName == 'list' || $actionName == 'count' || $actionName == 'listByReferenceId') && (!$ks || !$ks->isAdmin() && !$ks->verifyPrivileges(ks::PRIVILEGE_LIST, ks::PRIVILEGE_WILDCARD))) {
         KalturaCriterion::enableTag(KalturaCriterion::TAG_WIDGET_SESSION);
         entryPeer::setUserContentOnly(true);
     }
     /*		//to support list categories with entitlmenet for user that is a member of more then 100 large categories
      		//large category is a category with > 10 members or > 100 entries. 				
       		if ($actionName == 'list' && kEntitlementUtils::getEntitlementEnforcement())
     		{
     			$dispatcher = KalturaDispatcher::getInstance();
     			$arguments = $dispatcher->getArguments();
     			
     			$categoriesIds = array();
     			$categories = array();
     			foreach($arguments as $argument)
     			{
     				if ($argument instanceof KalturaBaseEntryFilter)
     				{
     					if(isset($argument->categoriesMatchAnd))
     						$categories = array_merge($categories, explode(',', $argument->categoriesMatchAnd));
     						
     					if(isset($argument->categoriesMatchOr))
     						$categories = array_merge($categories, explode(',', $argument->categoriesMatchOr));
     					
     					if(isset($argument->categoriesFullNameIn))
     						$categories = array_merge($categories, explode(',', $argument->categoriesFullNameIn));
     						
     					if(count($categories))
     					{
     						$categories = categoryPeer::getByFullNamesExactMatch($categories);
     						
     						foreach ($categories as $category)
     							$categoriesIds[] = $category->getId();
     					}
     										
     					if(isset($argument->categoriesIdsMatchAnd))
     						$categoriesIds = array_merge($categoriesIds, explode(',', $argument->categoriesIdsMatchAnd));
     					
     					if(isset($argument->categoriesIdsMatchOr))
     						$categoriesIds = array_merge($categoriesIds, explode(',', $argument->categoriesIdsMatchOr));
     					
     					if(isset($argument->categoryAncestorIdIn))
     						$categoriesIds = array_merge($categoriesIds, explode(',', $argument->categoryAncestorIdIn));
     				}
     			}
     			
     			foreach($categoriesIds as $key => $categoryId)
     			{
     				if(!$categoryId)
     				{
     					unset($categoriesIds[$key]);
     				}
     			}
     			
     			if(count($categoriesIds))
     				entryPeer::setFilterdCategoriesIds($categoriesIds);
     		}*/
     parent::initService($serviceId, $serviceName, $actionName);
     $this->applyPartnerFilterForClass('ConversionProfile');
     $this->applyPartnerFilterForClass('conversionProfile2');
 }