當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。