/** * Obtains a list of assets * * @return \Symfony\Component\HttpFoundation\Response */ public function getEntitiesAction() { if (!$this->security->isGranted('asset:assets:viewother')) { $this->listFilters[] = array('column' => 'a.createdBy', 'expr' => 'eq', 'value' => $this->factory->getUser()->getId()); } return parent::getEntitiesAction(); }
/** * Deletes a user. * * @param int $id User ID * * @return Response */ public function deleteEntityAction($id) { if (!$this->get('mautic.security')->isGranted('user:users:delete')) { return $this->accessDenied(); } return parent::deleteEntityAction($id); }
/** * Deletes a user * * @param int $id User ID * * @return Response */ public function deleteEntityAction($id) { if (!$this->factory->getSecurity()->isGranted('user:users:delete')) { return $this->accessDenied(); } return parent::deleteEntityAction($id); }
/** * Obtains a list of forms. * * @return \Symfony\Component\HttpFoundation\Response */ public function getEntitiesAction() { if (!$this->security->isGranted('form:forms:viewother')) { $this->listFilters = ['column' => 'f.createdBy', 'expr' => 'eq', 'value' => $this->user->getId()]; } return parent::getEntitiesAction(); }
/** * Obtains a list of emails * * @return \Symfony\Component\HttpFoundation\Response */ public function getEntitiesAction() { if (!$this->security->isGranted('email:emails:viewother')) { $this->listFilters[] = array('column' => 'e.createdBy', 'expr' => 'eq', 'value' => $this->factory->getUser()->getId()); } //get parent level only $this->listFilters[] = array('column' => 'e.variantParent', 'expr' => 'isNull'); return parent::getEntitiesAction(); }
public function initialize(FilterControllerEvent $event) { parent::initialize($event); $this->model = $this->factory->getModel('lead.list'); $this->entityClass = 'Mautic\\LeadBundle\\Entity\\LeadList'; $this->entityNameOne = 'list'; $this->entityNameMulti = 'lists'; $this->permissionBase = 'lead:lists'; $this->serializerGroups = array("leadListDetails", "userList", "publishDetails", "ipAddress"); }
/** * Obtains a list of pages. * * @return \Symfony\Component\HttpFoundation\Response */ public function getEntitiesAction() { if (!$this->security->isGranted('page:pages:viewother')) { $this->listFilters = ['column' => 'p.createdBy', 'expr' => 'eq', 'value' => $this->user->getId()]; } //get parent level only $this->listFilters[] = ['column' => 'p.variantParent', 'expr' => 'isNull']; $this->listFilters[] = ['column' => 'p.translationParent', 'expr' => 'isNull']; return parent::getEntitiesAction(); }
public function initialize(FilterControllerEvent $event) { parent::initialize($event); $this->model = $this->getModel('campaign'); $this->entityClass = 'Mautic\\CampaignBundle\\Entity\\Campaign'; $this->entityNameOne = 'campaign'; $this->entityNameMulti = 'campaigns'; $this->permissionBase = 'campaign:campaigns'; $this->serializerGroups = ['campaignDetails', 'categoryList', 'publishDetails']; }
/** * {@inheritdoc} */ public function initialize(FilterControllerEvent $event) { parent::initialize($event); $this->model = $this->getModel('point.trigger'); $this->entityClass = 'Mautic\\PointBundle\\Entity\\Trigger'; $this->entityNameOne = 'trigger'; $this->entityNameMulti = 'triggers'; $this->permissionBase = 'point:triggers'; $this->serializerGroups = ['triggerDetails', 'categoryList', 'publishDetails']; }
/** * {@inheritdoc} */ public function initialize(FilterControllerEvent $event) { parent::initialize($event); $this->model = $this->factory->getModel('point'); $this->entityClass = 'Mautic\\PointBundle\\Entity\\Point'; $this->entityNameOne = 'point'; $this->entityNameMulti = 'points'; $this->permissionBase = 'point:points'; $this->serializerGroups = array('pointDetails', 'categoryList', 'publishDetails'); }
public function initialize(FilterControllerEvent $event) { parent::initialize($event); $this->model = $this->getModel('dashboard'); $this->entityClass = 'Mautic\\DashboardBundle\\Entity\\Widget'; $this->entityNameOne = 'widget'; $this->entityNameMulti = 'widgets'; $this->permissionBase = 'dashboard:widgets'; $this->serializerGroups = []; }
/** * Creates a new lead or edits if one is found with same email. You should make a call to /api/leads/list/fields in order to get a list of custom fields that will be accepted. The key should be the alias of the custom field. You can also pass in a ipAddress parameter if the IP of the lead is different than that of the originating request. */ public function newEntityAction() { // Check for an email to see if the lead already exists $parameters = $this->request->request->all(); $uniqueLeadFields = $this->getModel('lead.field')->getUniqueIdentiferFields(); $uniqueLeadFieldData = []; foreach ($parameters as $k => $v) { if (array_key_exists($k, $uniqueLeadFields) && !empty($v)) { $uniqueLeadFieldData[$k] = $v; } } if (count($uniqueLeadFieldData)) { if (count($uniqueLeadFieldData)) { $existingLeads = $this->get('doctrine.orm.entity_manager')->getRepository('MauticLeadBundle:Lead')->getLeadsByUniqueFields($uniqueLeadFieldData); if (!empty($existingLeads)) { // Lead found so edit rather than create a new one return parent::editEntityAction($existingLeads[0]->getId()); } } } return parent::newEntityAction(); }
/** * Obtains a specific role * * @param int $id Role ID * * @return \Symfony\Component\HttpFoundation\Response * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException */ public function getEntityAction($id) { return parent::getEntityAction($id); }