public function aclUpdateAction() { if (null !== ($response = $this->checkAuth(AdminResources::MODULE, 'CustomerGroupAcl', AccessManager::CREATE))) { return $response; } $form = new AclForm($this->getRequest()); // TODO: catch possible exception $formValidate = $this->validateForm($form); $event = new AclEvent($formValidate->get('code')->getData(), $formValidate->get('module_id')->getData(), $formValidate->get('locale')->getData(), $formValidate->get('title')->getData(), $formValidate->get('description')->getData(), $formValidate->get('id')->getData() != null ? $formValidate->get('id')->getData() : null); $this->dispatch(CustomerGroupAclEvents::ACL_UPDATE, $event); return $this->generateRedirectFromRoute('admin.module.configure', [], ['module_code' => CustomerGroupAcl::getModuleCode()]); }
/** * @covers ModuleListener::load() */ public function testModuleConfigurationIsNotLoadedOnDeactivation() { // use this module for testing $testModule = ModuleQuery::create()->findOneByCode(CustomerGroupAcl::getModuleCode()); // activate it $testModule->reload(); $testModule->setActivate(true)->save(); // we expect the ACL configuration for our module to NOT be loaded $this->aclXmlFileloader->expects($this->never())->method("load")->with($this->equalTo($testModule)); // toggle the module $activationEvent = new ModuleToggleActivationEvent($testModule->getId()); $this->dispatcher->dispatch(TheliaEvents::MODULE_TOGGLE_ACTIVATION, $activationEvent); }
/** * Get the module id for this module. * @return int */ protected function getThisModuleId() { return ModuleQuery::create()->findOneByCode(CustomerGroupAcl::getModuleCode())->getId(); }