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


PHP Tinebase_Model_Filter_FilterGroup::setRequiredGrants方法代碼示例

本文整理匯總了PHP中Tinebase_Model_Filter_FilterGroup::setRequiredGrants方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tinebase_Model_Filter_FilterGroup::setRequiredGrants方法的具體用法?PHP Tinebase_Model_Filter_FilterGroup::setRequiredGrants怎麽用?PHP Tinebase_Model_Filter_FilterGroup::setRequiredGrants使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tinebase_Model_Filter_FilterGroup的用法示例。


在下文中一共展示了Tinebase_Model_Filter_FilterGroup::setRequiredGrants方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: checkFilterACL

 /**
  * Removes containers where current user has no access to
  *
  * @param Tinebase_Model_Filter_FilterGroup $_filter
  * @param string $_action get|update
  */
 public function checkFilterACL(Tinebase_Model_Filter_FilterGroup $_filter, $_action = 'get')
 {
     if (!$this->_doContainerACLChecks) {
         if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
             Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' Container ACL disabled for ' . $_filter->getModelName() . '.');
         }
         return TRUE;
     }
     $aclFilters = $_filter->getAclFilters();
     if (!$aclFilters) {
         if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
             Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Force a standard containerFilter (specialNode = all) as ACL filter.');
         }
         $containerFilter = $_filter->createFilter('container_id', 'specialNode', 'all', array('applicationName' => $_filter->getApplicationName()));
         $_filter->addFilter($containerFilter);
     }
     if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
         Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' Setting filter grants for action ' . $_action);
     }
     switch ($_action) {
         case 'get':
             $_filter->setRequiredGrants(array(Tinebase_Model_Grants::GRANT_READ, Tinebase_Model_Grants::GRANT_ADMIN));
             break;
         case 'update':
             $_filter->setRequiredGrants(array(Tinebase_Model_Grants::GRANT_EDIT, Tinebase_Model_Grants::GRANT_ADMIN));
             break;
         case 'export':
             $_filter->setRequiredGrants(array(Tinebase_Model_Grants::GRANT_EXPORT, Tinebase_Model_Grants::GRANT_ADMIN));
             break;
         case 'sync':
             $_filter->setRequiredGrants(array(Tinebase_Model_Grants::GRANT_SYNC, Tinebase_Model_Grants::GRANT_ADMIN));
             break;
         default:
             throw new Tinebase_Exception_UnexpectedValue('Unknown action: ' . $_action);
     }
 }
開發者ID:bitExpert,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:42,代碼來源:Abstract.php

示例2: checkFilterACL

 /**
  * Removes containers where current user has no access to
  * 
  * @param Timetracker_Model_TimeaccountFilter $_filter
  * @param string $_action
  */
 public function checkFilterACL(Tinebase_Model_Filter_FilterGroup $_filter, $_action = 'get')
 {
     switch ($_action) {
         case 'get':
             $_filter->setRequiredGrants(array(Timetracker_Model_TimeaccountGrants::BOOK_OWN, Timetracker_Model_TimeaccountGrants::BOOK_ALL, Timetracker_Model_TimeaccountGrants::VIEW_ALL, Tinebase_Model_Grants::GRANT_ADMIN));
             break;
         case 'update':
             $_filter->setRequiredGrants(array(Tinebase_Model_Grants::GRANT_ADMIN));
             break;
         case 'export':
             $_filter->setRequiredGrants(array(Tinebase_Model_Grants::GRANT_EXPORT, Tinebase_Model_Grants::GRANT_ADMIN));
             break;
         default:
             throw new Timetracker_Exception_UnexpectedValue('Unknown action: ' . $_action);
     }
 }
開發者ID:ingoratsdorf,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:22,代碼來源:Timeaccount.php

示例3: setRequiredGrants

 public function setRequiredGrants(array $_grants)
 {
     $this->_filterGroup->setRequiredGrants($_grants);
 }
開發者ID:carriercomm,項目名稱:Billing-5,代碼行數:4,代碼來源:OpenItemContactFilter.php


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