Ejemplo n.º 1
0
 /**
  * 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();
 }
Ejemplo n.º 2
0
 /**
  * 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);
 }
Ejemplo n.º 3
0
 /**
  * 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);
 }
Ejemplo n.º 4
0
 /**
  * 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();
 }
Ejemplo n.º 5
0
 /**
  * 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();
 }
Ejemplo n.º 6
0
 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");
 }
Ejemplo n.º 7
0
 /**
  * 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();
 }
Ejemplo n.º 8
0
 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'];
 }
Ejemplo n.º 9
0
 /**
  * {@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'];
 }
Ejemplo n.º 10
0
 /**
  * {@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');
 }
Ejemplo n.º 11
0
 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 = [];
 }
Ejemplo n.º 12
0
 /**
  * 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();
 }
Ejemplo n.º 13
0
 /**
  * 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);
 }