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


PHP ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel方法代码示例

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


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

示例1: actionDelete

 public function actionDelete($id)
 {
     $emailTemplate = static::getModelAndCatchNotFoundAndDisplayError('EmailTemplate', intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($emailTemplate);
     $type = $emailTemplate->type;
     $emailTemplate->delete();
     if ($type == EmailTemplate::TYPE_WORKFLOW) {
         $this->redirect(array($this->getId() . '/listForWorkflow'));
     } elseif ($emailTemplate->type == EmailTemplate::TYPE_CONTACT) {
         $this->redirect(array($this->getId() . '/listForMarketing'));
     } else {
         throw new NotSupportedException();
     }
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:14,代码来源:DefaultController.php

示例2: 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

示例3: testResolveAccessCanCurrentUserDeleteModel

 /**
  * @depends testResolveAccessCanCurrentUserWriteModel
  */
 public function testResolveAccessCanCurrentUserDeleteModel()
 {
     Yii::app()->user->userModel = User::getByUsername('super');
     $accounts = Account::getByName('Supermart');
     $this->assertEquals(1, count($accounts));
     $betty = User::getByUsername('betty');
     Yii::app()->user->userModel = $betty;
     $this->startOutputBuffer();
     try {
         ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($accounts[0], true);
         $this->endPrintOutputBufferAndFail();
     } catch (ExitException $e) {
         $content = $this->endAndGetOutputBuffer();
         $this->assertEquals('failure', $content);
     }
     $this->startOutputBuffer();
     try {
         ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($accounts[0], false);
         $this->endPrintOutputBufferAndFail();
     } catch (ExitException $e) {
         $compareString = 'You have tried to access a page you do not have access to';
         $this->assertContains($compareString, $this->endAndGetOutputBuffer());
     }
     $accounts = Account::getByName('BettyInc');
     $this->assertEquals(1, count($accounts));
     $account = $accounts[0];
     $this->startOutputBuffer();
     try {
         ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($account, true);
         ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($account, false);
         $content = $this->endAndGetOutputBuffer();
         $this->assertEquals(null, $content);
     } catch (ExitException $e) {
         $this->endPrintOutputBufferAndFail();
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:39,代码来源:ControllerSecurityUtilTest.php

示例4: actionDelete

 public function actionDelete($id)
 {
     $contactWebForm = ContactWebForm::getById(intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($contactWebForm);
     $contactWebForm->delete();
     $this->redirect(array($this->getId() . '/index'));
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:7,代码来源:DefaultController.php

示例5: actionDelete

 public function actionDelete($id)
 {
     if (!Unitofmeasure::isUnitofmeasureInUseById(intval($id))) {
         $unitofmeasures = Unitofmeasure::GetById(intval($id));
         ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($unitofmeasures);
         $unitofmeasures->delete();
     } else {
         Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'Not possible to delete. Unit Of Measure is already in use'));
     }
     $this->redirect(array($this->getId() . '/index'));
 }
开发者ID:RamaKavanan,项目名称:BaseVersion,代码行数:11,代码来源:DefaultController.php

示例6: actionDelete

 public function actionDelete($id)
 {
     $campaign = static::getModelAndCatchNotFoundAndDisplayError('Campaign', intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($campaign);
     $campaign->delete();
     $this->redirect(array($this->getId() . '/index'));
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:7,代码来源:DefaultController.php

示例7: actionDelete

 public function actionDelete($id)
 {
     $emailTemplate = static::getModelAndCatchNotFoundAndDisplayError('EmailTemplate', intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($emailTemplate);
     $redirectUrl = null;
     if ($emailTemplate->isWorkflowTemplate()) {
         $redirectUrl = $this->getId() . '/listForWorkflow';
     } elseif ($emailTemplate->isContactTemplate()) {
         $redirectUrl = $this->getId() . '/listForMarketing';
     }
     $emailTemplate->delete();
     if (isset($redirectUrl)) {
         $this->redirect(array($redirectUrl));
     } else {
         throw new NotSupportedException();
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:17,代码来源:DefaultController.php

示例8: processCopyRelationsAndDeleteNonPrimaryModelsInMerge

 /**
  * Processes copying relations from non primary models to primary model and than deleting them
  * @param RedBeanModel $primaryModel
  * @param array $getData data from $_GET
  */
 public static function processCopyRelationsAndDeleteNonPrimaryModelsInMerge($primaryModel, $getData)
 {
     assert('$primaryModel instanceof RedBeanModel');
     assert('is_array($getData)');
     $modelClassName = get_class($primaryModel);
     $selectedModelsList = self::getSelectedModelsListForMerge($modelClassName, $getData);
     self::processAssignRelationsToMergedModelFromModelsToBeDeleted($selectedModelsList, $primaryModel);
     foreach ($selectedModelsList as $selectedModel) {
         if ($selectedModel->id != $primaryModel->id && get_class($selectedModel) == get_class($primaryModel)) {
             ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($selectedModel);
             $selectedModel->delete();
         }
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:19,代码来源:ListViewMergeUtil.php

示例9: actionDelete

 public function actionDelete($id)
 {
     $gameReward = GameReward::GetById(intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($gameReward);
     $gameReward->delete();
     $this->redirect(array($this->getId() . '/index'));
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:7,代码来源:DefaultController.php

示例10: actionDeleteSavedSearch

 public function actionDeleteSavedSearch($id)
 {
     $savedSearch = SavedSearch::GetById(intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($savedSearch);
     $savedSearch->delete();
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:6,代码来源:DefaultController.php

示例11: resolveDeleteAll

 public function resolveDeleteAll()
 {
     $searchAttributeData['clauses'] = array(1 => array('attributeName' => 'owner', 'relatedAttributeName' => 'id', 'operatorType' => 'equals', 'value' => Yii::app()->user->userModel->id));
     $searchAttributeData['structure'] = '1';
     $joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('Notification');
     $where = RedBeanModelDataProvider::makeWhere('Notification', $searchAttributeData, $joinTablesAdapter);
     $models = Notification::getSubset($joinTablesAdapter, null, null, $where, null);
     foreach ($models as $model) {
         ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($model);
         $model->delete();
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:12,代码来源:NotificationMashableInboxRules.php

示例12: actionDeleteFromAjax

 public function actionDeleteFromAjax($id)
 {
     $notification = Notification::GetById(intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($notification);
     $notification->delete();
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:6,代码来源:DefaultController.php

示例13: actionDelete

 /**
  * @param $id
  * @param null $redirectUrl
  * @throws FailedToDeleteModelException
  */
 public function actionDelete($id, $redirectUrl = null)
 {
     $task = Task::getById(intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($task);
     if (!$task->delete()) {
         throw new FailedToDeleteModelException();
     }
 }
开发者ID:KulturedKitsch,项目名称:kulturedkitsch.info,代码行数:13,代码来源:DefaultController.php

示例14: actionDelete

 public function actionDelete($id)
 {
     if (!Category::isCategoryInUseById(intval($id))) {
         $category = Category::GetById(intval($id));
         ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($category);
         $category->delete();
     } else {
         Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'Not possible to delete. Category is already in use'));
     }
     $this->redirect(array($this->getId() . '/index'));
 }
开发者ID:RamaKavanan,项目名称:BaseVersion,代码行数:11,代码来源:DefaultController.php

示例15: actionCancelAssemblyStep2

 public function actionCancelAssemblyStep2($id)
 {
     $costbook = Costbook::GetById(intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserDeleteModel($costbook);
     if (!$costbook->delete()) {
         echo 0;
     } else {
         echo 1;
     }
 }
开发者ID:RamaKavanan,项目名称:BaseVersion,代码行数:10,代码来源:DefaultController.php


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