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


PHP ControllerSecurityUtil::resolveCanCurrentUserAccessModule方法代码示例

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


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

示例1: renderContent

 public function renderContent()
 {
     $accessContent = $this->resolveContentIfCurrentUserCanAccessChartByModule('OpportunitiesModule', 'OpportunitiesModulePluralLabel');
     if ($accessContent != null) {
         return $accessContent;
     }
     $chartDataProviderType = $this->getChartDataProviderType();
     $chartDataProvider = ChartDataProviderFactory::createByType($chartDataProviderType);
     ControllerSecurityUtil::resolveCanCurrentUserAccessModule($chartDataProvider->getModel()->getModuleClassName(), true);
     $chartData = $chartDataProvider->getChartData();
     Yii::import('ext.amcharts.AmChartMaker');
     $amChart = new AmChartMaker();
     $amChart->data = $chartData;
     $amChart->id = $this->uniqueLayoutId;
     $amChart->type = $this->resolveViewAndMetadataValueByName('type');
     $amChart->addSerialGraph('value', 'column');
     $amChart->xAxisName = $chartDataProvider->getXAxisName();
     $amChart->yAxisName = $chartDataProvider->getYAxisName();
     $amChart->yAxisUnitContent = Yii::app()->locale->getCurrencySymbol(Yii::app()->currencyHelper->getCodeForCurrentUserForDisplay());
     $javascript = $amChart->javascriptChart();
     Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $this->uniqueLayoutId, $javascript);
     $cClipWidget = new CClipWidget();
     $cClipWidget->beginClip("Chart");
     $cClipWidget->widget('application.core.widgets.AmChart', array('id' => $this->uniqueLayoutId));
     $cClipWidget->endClip();
     return $cClipWidget->getController()->clips['Chart'];
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:27,代码来源:OpportunitiesBySourceChartView.php

示例2: actionDetails

 public function actionDetails($id, $runReport = false)
 {
     $savedReport = SavedReport::getById((int) $id);
     ControllerSecurityUtil::resolveCanCurrentUserAccessModule($savedReport->moduleClassName);
     ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($savedReport, true);
     $report = SavedReportToReportAdapter::makeReportBySavedReport($savedReport);
     $portlet = Portlet::getById(intval($_GET['portletId']));
     $portlet->params = array('controllerId' => 'default', 'relationModuleId' => $this->getModule()->getId(), 'relationModel' => $report, 'redirectUrl' => Yii::app()->request->getRequestUri(), 'dataProvider' => $this->getDataProvider($report, $report->getId(), (bool) $runReport));
     $portletView = $portlet->getView();
     if (!RightsUtil::canUserAccessModule($portletView::getModuleClassName(), Yii::app()->user->userModel)) {
         $messageView = new AccessFailureView();
         $view = new AccessFailurePageView($messageView);
         echo $view->render();
         Yii::app()->end(0, false);
     }
     $view = new AjaxPageView($portletView);
     echo $view->render();
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:18,代码来源:DefaultPortletController.php

示例3: actionExport

 public function actionExport($id, $stickySearchKey = null)
 {
     assert('$stickySearchKey == null || is_string($stickySearchKey)');
     $savedReport = SavedReport::getById((int) $id);
     ControllerSecurityUtil::resolveCanCurrentUserAccessModule($savedReport->moduleClassName);
     ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($savedReport);
     $report = SavedReportToReportAdapter::makeReportBySavedReport($savedReport);
     $dataProvider = $this->getDataProviderForExport($report, $report->getId(), false);
     $totalItems = intval($dataProvider->calculateTotalItemCount());
     $data = array();
     if ($totalItems > 0) {
         if ($totalItems <= ExportModule::$asynchronousThreshold) {
             // Output csv file directly to user browser
             if ($dataProvider) {
                 $reportToExportAdapter = ReportToExportAdapterFactory::createReportToExportAdapter($report, $dataProvider);
                 $headerData = $reportToExportAdapter->getHeaderData();
                 $data = $reportToExportAdapter->getData();
             }
             // Output data
             if (count($data)) {
                 $fileName = $this->getModule()->getName() . ".csv";
                 ExportItemToCsvFileUtil::export($data, $headerData, $fileName, true);
             } else {
                 Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'There is no data to export.'));
             }
         } else {
             if ($dataProvider) {
                 $serializedData = ExportUtil::getSerializedDataForExport($dataProvider);
             }
             // Create background job
             $exportItem = new ExportItem();
             $exportItem->isCompleted = 0;
             $exportItem->exportFileType = 'csv';
             $exportItem->exportFileName = $this->getModule()->getName();
             $exportItem->modelClassName = 'SavedReport';
             $exportItem->serializedData = $serializedData;
             $exportItem->save();
             $exportItem->forget();
             Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'A large amount of data has been requested for export.  You will receive ' . 'a notification with the download link when the export is complete.'));
         }
     } else {
         Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'There is no data to export.'));
     }
     $this->redirect(array($this->getId() . '/index'));
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:45,代码来源:DefaultController.php

示例4: actionDelete

 public function actionDelete($id)
 {
     $savedWorkflow = SavedWorkflow::GetById(intval($id));
     ControllerSecurityUtil::resolveCanCurrentUserAccessModule($savedWorkflow->moduleClassName);
     ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($savedWorkflow);
     $savedWorkflow->delete();
     $this->redirect(array($this->getId() . '/index'));
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:8,代码来源:DefaultController.php

示例5: actionExportpdf

 public function actionExportpdf($id, $stickySearchKey = null)
 {
     assert('$stickySearchKey == null || is_string($stickySearchKey)');
     $savedReport = SavedReport::getById((int) $id);
     ControllerSecurityUtil::resolveCanCurrentUserAccessModule($savedReport->moduleClassName);
     ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($savedReport);
     $report = SavedReportToReportAdapter::makeReportBySavedReport($savedReport);
     $dataProvider = $this->getDataProviderForExport($report, $report->getId(), false);
     $totalItems = intval($dataProvider->calculateTotalItemCount());
     $data = array();
     if ($totalItems > 0) {
         $reportToExportAdapter = ReportToExportAdapterFactory::createReportToExportAdapter($report, $dataProvider);
         $headerData = $reportToExportAdapter->getHeaderData();
         $data = $reportToExportAdapter->getData();
         $mPDF1 = Yii::app()->ePdf->mpdf('utf-8', 'Letter');
         $pdfdata = '<table border="1" style="border-collapse:collapse;" cellpadding="0" cellspacing="1"><tbody><tr>';
         foreach ($headerData as $key => $value) {
             $pdfdata .= '<td>' . $value . '</td>';
         }
         $pdfdata .= '</tr>';
         foreach ($data as $key => $value) {
             $pdfdata .= '<tr>';
             foreach ($value as $key1 => $value1) {
                 $pdfdata .= '<td>' . $value1 . '</td>';
             }
             $pdfdata .= '</tr>';
         }
         $pdfdata .= '</tbody></table>';
         $mPDF1->WriteHTML($pdfdata);
         $mPDF1->Output($this->getModule()->getName() . '.pdf', 'D');
     } else {
         Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'There is no data to export.'));
     }
     $this->redirect(array($this->getId() . '/index'));
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:35,代码来源:DefaultController.php


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