Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
40685204
Commit
40685204
authored
Nov 23, 2020
by
Piotr Gawron
Browse files
Merge branch '1370-overlay-list' into 'devel_15.1.x'
return proper status code for non existing project See merge request
!1255
parents
2e067a25
efbc4b1c
Pipeline
#34554
failed with stage
in 15 minutes and 30 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
40685204
...
...
@@ -3,6 +3,8 @@ minerva (15.1.1) stable; urgency=medium
generated
files
that
could
not
be
opened
in
CellDesigner
(#
1363
)
*
Bug
fix
:
zoom
level
change
was
not
reflected
in
the
url
when
submap
was
opened
(#
1338
)
*
Bug
fix
:
API
call
returning
list
of
overlays
returned
for
non
existing
project
returned
access
denied
status
insted
Not
Found
(#
1370
)
--
Piotr
Gawron
<
piotr
.
gawron
@
uni
.
lu
>
Thu
,
23
Nov
2020
15
:
00
:
00
+
0200
...
...
rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayController.java
View file @
40685204
...
...
@@ -29,7 +29,8 @@ public class OverlayController extends BaseController {
this
.
userService
=
userService
;
}
@PreAuthorize
(
"hasAnyAuthority('IS_ADMIN', 'READ_PROJECT:' + #projectId)"
)
@PreAuthorize
(
"hasAnyAuthority('IS_ADMIN', 'READ_PROJECT:' + #projectId) "
+
"or not @projectService.projectExists(#projectId)"
)
@PostFilter
(
"hasAuthority('IS_ADMIN')"
+
" or hasAuthority('IS_CURATOR') and hasAuthority('READ_PROJECT:' + #projectId)"
+
" or hasAuthority('READ_PROJECT:' + #projectId) and (filterObject['creator'] == authentication.name or filterObject['publicOverlay'])"
)
...
...
web/src/test/java/lcsb/mapviewer/web/OverlayControllerIntegrationTestWithoutTransaction.java
View file @
40685204
...
...
@@ -112,4 +112,14 @@ public class OverlayControllerIntegrationTestWithoutTransaction extends Controll
removeUserInSeparateThread
(
user
);
}
}
@Test
public
void
testListOverlaysByCreatorInNonExistingProject
()
throws
Exception
{
RequestBuilder
request
=
get
(
"/projects/NotExisting/overlays/?creator=blable"
);
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
isNotFound
());
}
}
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