本文整理匯總了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);
}
}
示例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);
}
}
示例3: setRequiredGrants
public function setRequiredGrants(array $_grants)
{
$this->_filterGroup->setRequiredGrants($_grants);
}