当前位置: 首页>>代码示例>>PHP>>正文


PHP Tinebase_Model_Filter_FilterGroup::getAclFilters方法代码示例

本文整理汇总了PHP中Tinebase_Model_Filter_FilterGroup::getAclFilters方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_Model_Filter_FilterGroup::getAclFilters方法的具体用法?PHP Tinebase_Model_Filter_FilterGroup::getAclFilters怎么用?PHP Tinebase_Model_Filter_FilterGroup::getAclFilters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tinebase_Model_Filter_FilterGroup的用法示例。


在下文中一共展示了Tinebase_Model_Filter_FilterGroup::getAclFilters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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

 /**
  * redefine required grants for get actions
  * 
  * @param Tinebase_Model_Filter_FilterGroup $_filter
  * @param string $_action get|update
  */
 public function checkFilterACL(Tinebase_Model_Filter_FilterGroup $_filter, $_action = 'get')
 {
     $hasGrantsFilter = FALSE;
     foreach ($_filter->getAclFilters() as $aclFilter) {
         if ($aclFilter instanceof Calendar_Model_GrantFilter) {
             $hasGrantsFilter = TRUE;
             break;
         }
     }
     if (!$hasGrantsFilter) {
         // force a grant filter
         // NOTE: actual grants are set via setRequiredGrants later
         $grantsFilter = $_filter->createFilter('grants', 'in', '@setRequiredGrants');
         $_filter->addFilter($grantsFilter);
     }
     parent::checkFilterACL($_filter, $_action);
     if ($_action == 'get') {
         $_filter->setRequiredGrants(array(Tinebase_Model_Grants::GRANT_FREEBUSY, Tinebase_Model_Grants::GRANT_READ, Tinebase_Model_Grants::GRANT_ADMIN));
     }
 }
开发者ID:hernot,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:26,代码来源:Event.php


注:本文中的Tinebase_Model_Filter_FilterGroup::getAclFilters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。