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


PHP ZurmoDatabaseCompatibilityUtil::callFunction方法代码示例

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


在下文中一共展示了ZurmoDatabaseCompatibilityUtil::callFunction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fastContainsUserByGroupName

 protected static function fastContainsUserByGroupName($groupName, $userId)
 {
     // Optimizations work on the database,
     // anything not saved will not work.
     assert('$userId > 0');
     // Not Coding Standard
     assert('is_string($groupName) && $groupName != ""');
     // Not Coding Standard
     assert('is_int($userId) && $userId > 0');
     // Not Coding Standard
     return intval(ZurmoDatabaseCompatibilityUtil::callFunction("named_group_contains_user('{$groupName}', {$userId})")) == 1;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:12,代码来源:GroupBenchmarkTest.php

示例2: getActualPermissions

 public function getActualPermissions($permitable = null)
 {
     assert('$permitable === null || $permitable instanceof Permitable');
     if ($permitable === null) {
         $permitable = Yii::app()->user->userModel;
         if (!$permitable instanceof User) {
             throw new NoCurrentUserSecurityException();
         }
     }
     if (!SECURITY_OPTIMIZED) {
         // The slow way will remain here as documentation
         // for what the optimized way is doing.
         $allowPermissions = Permission::NONE;
         $denyPermissions = Permission::NONE;
         if (Group::getByName(Group::SUPER_ADMINISTRATORS_GROUP_NAME)->contains($permitable)) {
             $allowPermissions = Permission::ALL;
         } else {
             foreach ($this->unrestrictedGet('permissions') as $permission) {
                 $effectivePermissions = $permission->getEffectivePermissions($permitable);
                 if ($permission->type == Permission::ALLOW) {
                     $allowPermissions |= $effectivePermissions;
                 } else {
                     $denyPermissions |= $effectivePermissions;
                 }
             }
             $allowPermissions |= $this->getPropagatedActualAllowPermissions($permitable);
             if (!$this instanceof NamedSecurableItem) {
                 foreach (array(get_class($this), static::getModuleClassName()) as $securableItemName) {
                     try {
                         $securableType = NamedSecurableItem::getByName($securableItemName);
                         $typeAllowPermissions = Permission::NONE;
                         $typeDenyPermissions = Permission::NONE;
                         foreach ($securableType->unrestrictedGet('permissions') as $permission) {
                             $effectivePermissions = $permission->getEffectivePermissions($permitable);
                             if ($permission->type == Permission::ALLOW) {
                                 $typeAllowPermissions |= $effectivePermissions;
                             } else {
                                 $typeDenyPermissions |= $effectivePermissions;
                             }
                             // We shouldn't see something that isn't owned having CHANGE_OWNER.
                             // assert('$typeAllowPermissions & Permission::CHANGE_OWNER == Permission::NONE');
                         }
                         $allowPermissions |= $typeAllowPermissions;
                         $denyPermissions |= $typeDenyPermissions;
                     } catch (NotFoundException $e) {
                     }
                 }
             }
         }
     } else {
         try {
             $combinedPermissions = PermissionsCache::getCombinedPermissions($this, $permitable);
         } catch (NotFoundException $e) {
             $securableItemId = $this->getClassId('SecurableItem');
             $permitableId = $permitable->getClassId('Permitable');
             // Optimizations work on the database,
             // anything not saved will not work.
             assert('$permitableId > 0');
             $className = get_class($this);
             $moduleName = static::getModuleClassName();
             $cachingOn = DB_CACHING_ON ? 1 : 0;
             $combinedPermissions = intval(ZurmoDatabaseCompatibilityUtil::callFunction("get_securableitem_actual_permissions_for_permitable({$securableItemId}, {$permitableId}, '{$className}', '{$moduleName}', {$cachingOn})"));
             PermissionsCache::cacheCombinedPermissions($this, $permitable, $combinedPermissions);
         }
         $allowPermissions = $combinedPermissions >> 8 & Permission::ALL;
         $denyPermissions = $combinedPermissions & Permission::ALL;
     }
     assert("({$allowPermissions} & ~Permission::ALL) == 0");
     assert("({$denyPermissions}  & ~Permission::ALL) == 0");
     return array($allowPermissions, $denyPermissions);
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:71,代码来源:SecurableItem.php

示例3: getInheritedActualRight

 public function getInheritedActualRight($moduleName, $rightName)
 {
     assert('is_string($moduleName)');
     assert('is_string($rightName)');
     assert('$moduleName != ""');
     assert('$rightName  != ""');
     if ($this->isEveryone) {
         return Right::NONE;
     }
     if (!SECURITY_OPTIMIZED) {
         return parent::getInheritedActualRight($moduleName, $rightName);
     } else {
         // Optimizations work on the database,
         // anything not saved will not work.
         assert('$this->id > 0');
         return intval(ZurmoDatabaseCompatibilityUtil::callFunction("get_group_inherited_actual_right({$this->id}, '{$moduleName}', '{$rightName}')"));
     }
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:18,代码来源:Group.php

示例4: getExplicitActualPolicy

 /**
  * @param string $moduleName
  * @param string $policyName
  * @return mixed|null|string
  */
 public function getExplicitActualPolicy($moduleName, $policyName)
 {
     assert('is_string($moduleName)');
     assert('is_string($policyName)');
     assert('$moduleName != ""');
     assert('$policyName != ""');
     if (!SECURITY_OPTIMIZED) {
         // The slow way will remain here as documentation
         // for what the optimized way is doing.
         foreach ($this->policies as $policy) {
             if ($policy->moduleName == $moduleName && $policy->name == $policyName) {
                 return $policy->value;
             }
         }
         return null;
     } else {
         $permitableId = $this->getClassId('Permitable');
         try {
             // not using $default because computing default value would involve extra cpu cycles each time.
             return PoliciesCache::getEntry($permitableId . $moduleName . $policyName . 'ExplicitActualPolicy');
         } catch (NotFoundException $e) {
             $explictActualPolicy = ZurmoDatabaseCompatibilityUtil::callFunction("get_permitable_explicit_actual_policy(\n                                                         {$permitableId}, '{$moduleName}', '{$policyName}')");
         }
         PoliciesCache::cacheEntry($permitableId . $moduleName . $policyName . 'ExplicitActualPolicy', $explictActualPolicy);
         return $explictActualPolicy;
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:32,代码来源:Permitable.php


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