mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Fix latest merge
This commit is contained in:
1
composer.lock
generated
1
composer.lock
generated
@@ -1426,7 +1426,6 @@
|
||||
"export",
|
||||
"import"
|
||||
],
|
||||
"time": "2013-11-22 19:10:34"
|
||||
"time": "2014-01-12 16:34:06"
|
||||
},
|
||||
{
|
||||
|
@@ -1426,7 +1426,9 @@ class V1 implements ControllerProviderInterface
|
||||
public function get_publications(Application $app, Request $request)
|
||||
{
|
||||
$user = $app['authentication']->getUser();
|
||||
$feed = Aggregate::createFromUser($app, $user);
|
||||
$restrictions = (array) ($request->get('feeds') ? : array());
|
||||
|
||||
$feed = Aggregate::createFromUser($app, $user, $restrictions);
|
||||
|
||||
$offset_start = (int) ($request->get('offset_start') ? : 0);
|
||||
$per_page = (int) ($request->get('per_page') ? : 5);
|
||||
|
@@ -495,7 +495,7 @@ class Informations implements ControllerProviderInterface
|
||||
'rs' => $html,
|
||||
'display_nav' => false,
|
||||
'title' => $title
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -76,7 +76,7 @@ class Aggregate implements FeedInterface
|
||||
*
|
||||
* @return Aggregate
|
||||
*/
|
||||
public static function createFromUser(Application $app, User $user)
|
||||
public static function createFromUser(Application $app, User $user, array $restrictions = [])
|
||||
{
|
||||
$feeds = $app['repo.feeds']->getAllForUser($app['acl']->get($user));
|
||||
$token = $app['repo.aggregate-tokens']->findOneBy(['user' => $user]);
|
||||
|
@@ -26,7 +26,7 @@ class FeedRepository extends EntityRepository
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getAllForUser(\ACL $userACL)
|
||||
public function getAllForUser(\ACL $userACL, array $restrictions = [])
|
||||
{
|
||||
$base_ids = array_keys($userACL->get_granted_base());
|
||||
|
||||
@@ -40,6 +40,10 @@ class FeedRepository extends EntityRepository
|
||||
$qb->orWhere($qb->expr()->in('f.baseId', $base_ids));
|
||||
}
|
||||
|
||||
if (count($restrictions) > 0) {
|
||||
$qb->andWhere($qb->expr()->in('f.id', $restrictions));
|
||||
}
|
||||
|
||||
$qb->orderBy('f.updatedOn', 'DESC');
|
||||
|
||||
return $qb->getQuery()->getResult();
|
||||
|
Reference in New Issue
Block a user