本文整理汇总了PHP中ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel方法的典型用法代码示例。如果您正苦于以下问题:PHP ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel方法的具体用法?PHP ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel怎么用?PHP ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ControllerSecurityUtil
的用法示例。
在下文中一共展示了ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resolveHtmlByEmailTemplateModel
/**
* Resolve html for a builder template provided the model itself.
* @param EmailTemplate $emailTemplate
* @param bool $renderForCanvas
* @param OwnedSecurableItem $attachedMergeTagModel
* @return bool|null|string
*/
public static function resolveHtmlByEmailTemplateModel(EmailTemplate $emailTemplate, $renderForCanvas = false, OwnedSecurableItem $attachedMergeTagModel = null)
{
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($emailTemplate);
$serializedData = $emailTemplate->serializedData;
$resolvedHtml = static::resolveHtmlBySerializedData($serializedData, $renderForCanvas, $attachedMergeTagModel, $emailTemplate->type, $emailTemplate->language);
return $resolvedHtml;
}
示例2: resolveHtmlByEmailTemplateModel
/**
* Resolve html for a builder template provided the model itself.
* @param EmailTemplate $emailTemplate
* @param bool $renderForCanvas
* @return bool|null|string
*/
public static function resolveHtmlByEmailTemplateModel(EmailTemplate $emailTemplate, $renderForCanvas = false)
{
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($emailTemplate);
$serializedData = $emailTemplate->serializedData;
$resolvedHtml = static::resolveHtmlBySerializedData($serializedData, $renderForCanvas);
return $resolvedHtml;
}
示例3: actionDetails
public function actionDetails($id, $redirectUrl = null)
{
$emailMessage = EmailMessage::getById(intval($id));
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($emailMessage);
$detailsView = new EmailMessageEditAndDetailsView('Details', $this->getId(), $this->getModule()->getId(), $emailMessage);
$view = new EmailMessagesPageView(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $detailsView));
echo $view->render();
}
示例4: actionDetails
public function actionDetails($id)
{
$animal = static::getModelAndCatchNotFoundAndDisplayError('Animal', intval($id));
$breadCrumbView = StickySearchUtil::resolveBreadCrumbViewForDetailsControllerAction($this, 'AnimalsSearchView', $animal);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($animal);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($animal), 'AnimalsModule'), $animal);
$titleBarAndEditView = $this->makeEditAndDetailsView($animal, 'Details');
$view = new AnimalsPageView(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $titleBarAndEditView));
echo $view->render();
}
示例5: actionDetails
public function actionDetails($id)
{
$conversation = static::getModelAndCatchNotFoundAndDisplayError('Conversation', intval($id));
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($conversation);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($conversation), 'ConversationsModule'), $conversation);
ConversationsUtil::markUserHasReadLatest($conversation, Yii::app()->user->userModel);
$detailsView = new ConversationDetailsView($this->getId(), $this->getModule()->getId(), $conversation);
$conversationsMashableInboxUrl = Yii::app()->createUrl('mashableInbox/default/list', array('modelClassName' => 'Conversation'));
$breadcrumbLinks = array(Zurmo::t('ConversationsModule', 'Conversations') => $conversationsMashableInboxUrl, StringUtil::getChoppedStringContent(strval($conversation), 25));
$view = new ConversationsPageView(ZurmoDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $detailsView, $breadcrumbLinks, 'ConversationBreadCrumbView'));
echo $view->render();
}
示例6: 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();
}
示例7: resolveSourceModelByPostSourceDataAttributes
protected function resolveSourceModelByPostSourceDataAttributes($id, $className, $skipSecurityCheck = false)
{
$sourceModel = $className::getById(intval($id));
if (!$skipSecurityCheck) {
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($sourceModel);
}
return $sourceModel;
}
示例8: actionCopy
public function actionCopy($id)
{
$copyToOpportunity = new Opportunity();
$postVariableName = get_class($copyToOpportunity);
if (!isset($_POST[$postVariableName])) {
$opportunity = Opportunity::getById((int) $id);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($opportunity);
ZurmoCopyModelUtil::copy($opportunity, $copyToOpportunity);
}
$this->processEdit($copyToOpportunity);
}
示例9: resolveSavedReportAndReportByPostData
protected function resolveSavedReportAndReportByPostData(array $postData, &$savedReport, &$report, $type, $id = null, $isBeingCopied = false)
{
if ($id == null) {
$this->resolveCanCurrentUserAccessReports();
$savedReport = new SavedReport();
$report = new Report();
$report->setType($type);
} elseif ($isBeingCopied) {
$savedReport = new SavedReport();
$oldReport = SavedReport::getById(intval($id));
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($oldReport);
SavedReportCopyModelUtil::copy($oldReport, $savedReport);
$report = SavedReportToReportAdapter::makeReportBySavedReport($savedReport);
} else {
$savedReport = SavedReport::getById(intval($id));
ControllerSecurityUtil::resolveAccessCanCurrentUserWriteModel($savedReport);
$report = SavedReportToReportAdapter::makeReportBySavedReport($savedReport);
}
DataToReportUtil::resolveReportByWizardPostData($report, $postData, ReportToWizardFormAdapter::getFormClassNameByType($type));
}
示例10: actionCopy
/**
* Copies the product
* @param int $id
*/
public function actionCopy($id)
{
$copyToProduct = new Product();
$postVariableName = get_class($copyToProduct);
if (!isset($_POST[$postVariableName])) {
$product = Product::getById((int) $id);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($product);
ProductZurmoCopyModelUtil::copy($product, $copyToProduct);
}
$this->processEdit($copyToProduct);
}
示例11: actionDashboardDetails
public function actionDashboardDetails($id)
{
if (intval($id) > 0) {
$dashboard = Dashboard::getById(intval($id));
$layoutId = $dashboard->layoutId;
} else {
$dashboard = Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, Yii::app()->user->userModel);
$layoutId = $dashboard->layoutId;
}
$params = array('controllerId' => $this->getId(), 'moduleId' => $this->getModule()->getId());
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($dashboard);
Portlet::resolvePortletCollectionColumnIndexes($layoutId);
$homeTitleBarAndDashboardView = new HomeTitleBarAndDashboardView($this->getId(), $this->getModule()->getId(), 'HomeDashboard' . $layoutId, $dashboard, $params);
$view = new HomePageView(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $homeTitleBarAndDashboardView));
echo $view->render();
}
示例12: actionCopy
/**
* @param $id
* @param null $redirectUrl
*/
public function actionCopy($id, $redirectUrl = null)
{
$modelClassName = $this->getModule()->getPrimaryModelName();
$copyToActivity = new $modelClassName();
$postVariableName = get_class($copyToActivity);
if (!isset($_POST[$postVariableName])) {
$activity = $modelClassName::getById((int) $id);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($activity);
ActivityCopyModelUtil::copy($activity, $copyToActivity);
}
$this->processEdit($copyToActivity, $redirectUrl);
}
示例13: actionUsersInGroupModalList
public function actionUsersInGroupModalList($id)
{
$model = Group::getById((int) $id);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($model);
$searchAttributeData = UsersByModelModalListControllerUtil::makeModalSearchAttributeDataByModel($model, 'groups');
$dataProvider = UsersByModelModalListControllerUtil::makeDataProviderBySearchAttributeData($searchAttributeData);
Yii::app()->getClientScript()->setToAjaxMode();
echo UsersByModelModalListControllerUtil::renderList($this, $dataProvider, 'usersInGroupModalList');
}
示例14: actionGetDepartmentReferenceLaborCostAndBurdonCostToCopy
public function actionGetDepartmentReferenceLaborCostAndBurdonCostToCopy($id)
{
$departmentReference = static::getModelAndCatchNotFoundAndDisplayError('DepartmentReference', intval($id));
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($departmentReference);
$data = array();
if ($departmentReference->laborCost != null) {
$data['laborCost'] = $departmentReference->laborCost;
}
if ($departmentReference->burdonCost != null) {
$data['burdonCost'] = $departmentReference->burdonCost;
}
echo CJSON::encode($data);
}
示例15: actionDrillDownDetails
public function actionDrillDownDetails($campaignItemId)
{
$id = (int) $campaignItemId;
$campaignItem = CampaignItem::getById($id);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($campaignItem->campaign);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($campaignItem->contact);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($campaignItem->emailMessage);
echo CampaignItemSummaryListViewColumnAdapter::resolveDrillDownMetricsSummaryContent($campaignItem);
}