Commit d16998ed authored by François Agneray's avatar François Agneray
Browse files

List private datasets if token => done

parent e2bc6f2c
......@@ -59,14 +59,14 @@ final class DatasetListByInstanceAction extends AbstractAction
$roles = $token->getClaim('realm_access')->roles;
if (!in_array('anis_admin', $roles)) {
// If user is not an admin return public datasets
// And returns datasets from user's groups
$qb->andWhere($qb->expr()->eq('d.public', 'true'));
// TODO: And returns datasets from user's groups
$qb2 = $this->em->createQueryBuilder();
$qb2->select('d.name')
$qb2->select('d2.name')
->from('App\Entity\Group', 'g')
->join('g.datasets', 'd')
->where($qb2->expr()->in('g.label', $roles));
$qb->andWhere($qb->expr()->in('d.name', $qb2));
->join('g.datasets', 'd2')
->where($qb2->expr()->in('g.role', $roles));
$qb->orWhere($qb->expr()->in('d.name', $qb2->getDQL()));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment