Skip to content

Commit

Permalink
Fixes for CR
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuba Płaskonka committed Feb 26, 2020
1 parent d9c7a97 commit 9d80541
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ScheduledExportBundle/Controller/GridConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Divante\ScheduledExportBundle\Controller;

use Pimcore\Bundle\AdminBundle\Controller\AdminController;
use Pimcore\Bundle\AdminBundle\HttpFoundation\JsonResponse;
use Pimcore\Bundle\AdminBundle\Security\User\User;
use Pimcore\Model\DataObject\ClassDefinition;
use Pimcore\Model\GridConfig;
Expand All @@ -16,18 +17,21 @@
*/
class GridConfigController extends AdminController
{
/** @var string True indicator for share globally */
const SHARE_GLOBALLY_TRUE = "1";

/**
* @param Request $request
* @return \Pimcore\Bundle\AdminBundle\HttpFoundation\JsonResponse
* @throws \Exception
*
* @Route("/admin/scheduled-export/grid-config/get-list")
*/
public function getListAction(Request $request)
public function getListAction(Request $request) : JsonResponse
{
$user = $this->getAdminUser();
$gridConfigs = new GridConfig\Listing();
$gridConfigs->setCondition("ownerId = ? or shareGlobally = 1", [$user->getId()]);
$gridConfigs->setCondition("ownerId = ? or shareGlobally = ?", [$user->getId(), self::SHARE_GLOBALLY_TRUE]);
$gridConfigs->load();
$result = [];

Expand Down

0 comments on commit 9d80541

Please sign in to comment.