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


PHP RightsUtil::cacheAllRightsByPermitable方法代码示例

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


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

示例1: actionRebuildSecurityCache

 public function actionRebuildSecurityCache($User_page = 1, $continue = false)
 {
     if (!Group::isUserASuperAdministrator(Yii::app()->user->userModel)) {
         $failureMessageContent = Zurmo::t('Core', 'You must be a super administrator to rebuild the security cache.');
         $messageView = new AccessFailureView($failureMessageContent);
         $view = new AccessFailurePageView($messageView);
         echo $view->render();
         Yii::app()->end(0, false);
     }
     if ($User_page == 1) {
         //to more quickly show the view to the user. To give a better indication of what is happening.
         $pageSize = 1;
     } else {
         $pageSize = 25;
     }
     $namedSecurableItems = array();
     $modules = Module::getModuleObjects();
     foreach ($modules as $module) {
         if ($module instanceof SecurableModule) {
             $namedSecurableItems[] = NamedSecurableItem::getByName(get_class($module));
         }
     }
     if ($continue) {
         $page = static::getMassActionProgressStartFromGet('User_page', $pageSize);
     } else {
         $page = 1;
     }
     $title = Zurmo::t('ZurmoModule', 'Rebuilding Cache');
     $searchAttributeData['clauses'] = array(1 => array('attributeName' => 'isSystemUser', 'operatorType' => 'equals', 'value' => 0), 2 => array('attributeName' => 'isSystemUser', 'operatorType' => 'isNull', 'value' => null));
     $searchAttributeData['structure'] = '1 or 2';
     $dataProvider = RedBeanModelDataProviderUtil::makeDataProvider($searchAttributeData, 'User', 'RedBeanModelDataProvider', null, false, $pageSize);
     $selectedRecordCount = $dataProvider->getTotalItemCount();
     $users = $dataProvider->getData();
     foreach ($users as $user) {
         if (!$user->isSuperAdministrator()) {
             foreach ($namedSecurableItems as $namedSecurableItem) {
                 $namedSecurableItem->getActualPermissions($user);
             }
         }
         RightsUtil::cacheAllRightsByPermitable($user);
     }
     $rebuildView = new RebuildSecurityCacheProgressView($this->getId(), $this->getModule()->getId(), new User(), $selectedRecordCount, $page, $pageSize, $User_page, 'rebuildSecurityCache', $title);
     if (!$continue) {
         $view = new ZurmoPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, $rebuildView));
         echo $view->render();
         Yii::app()->end(0, false);
     } else {
         echo $rebuildView->renderRefreshJSONScript();
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:50,代码来源:DevelopmentController.php


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