Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
efbc4b1c
Commit
efbc4b1c
authored
Nov 23, 2020
by
Piotr Gawron
Browse files
return proper status code for non existing project
parent
2e067a25
Pipeline
#34553
passed with stage
in 13 minutes and 55 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
efbc4b1c
...
...
@@ -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 @
efbc4b1c
...
...
@@ -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 @
efbc4b1c
...
...
@@ -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
Supports
Markdown
0%
Try again
or
attach a new 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