Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
anis
anis-server
Commits
d16998ed
Commit
d16998ed
authored
Dec 01, 2020
by
François Agneray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
List private datasets if token => done
parent
e2bc6f2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/Action/DatasetListByInstanceAction.php
src/Action/DatasetListByInstanceAction.php
+5
-5
No files found.
src/Action/DatasetListByInstanceAction.php
View file @
d16998ed
...
...
@@ -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
(
'd
2
.name'
)
->
from
(
'App\Entity\Group'
,
'g'
)
->
join
(
'g.datasets'
,
'd'
)
->
where
(
$qb2
->
expr
()
->
in
(
'g.
label
'
,
$roles
));
$qb
->
and
Where
(
$qb
->
expr
()
->
in
(
'd.name'
,
$qb2
));
->
join
(
'g.datasets'
,
'd
2
'
)
->
where
(
$qb2
->
expr
()
->
in
(
'g.
role
'
,
$roles
));
$qb
->
or
Where
(
$qb
->
expr
()
->
in
(
'd.name'
,
$qb2
->
getDQL
()
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment