Commit f9eeda84 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

owner reverted to creator

parent d2ec5a43
......@@ -34,7 +34,7 @@ public class OverlayController extends BaseController {
@PreAuthorize("hasAnyAuthority('IS_ADMIN', 'READ_PROJECT:' + #projectId)")
@PostFilter("hasAuthority('IS_ADMIN')" +
" or hasAuthority('IS_CURATOR') and hasAuthority('READ_PROJECT:' + #projectId)" +
" or hasAuthority('READ_PROJECT:' + #projectId) and (filterObject['owner'] == authentication.name or filterObject['publicOverlay'])")
" or hasAuthority('READ_PROJECT:' + #projectId) and (filterObject['creator'] == authentication.name or filterObject['publicOverlay'])")
@GetMapping(value = "/")
public List<Map<String, Object>> getOverlayList(
@PathVariable(value = "projectId") String projectId,
......@@ -42,13 +42,13 @@ public class OverlayController extends BaseController {
@RequestParam(value = "publicOverlay", defaultValue = "false") boolean publicOverlay) {
return overlayRestImp.getOverlayList(projectId).stream()
.filter(overlay -> !publicOverlay || (Boolean) overlay.get("publicOverlay"))
.filter(overlay -> creator.isEmpty() || (overlay.get("owner") != null && overlay.get("owner").equals(creator)))
.filter(overlay -> creator.isEmpty() || (overlay.get("creator") != null && overlay.get("creator").equals(creator)))
.collect(Collectors.toList());
}
@PostAuthorize("hasAuthority('IS_ADMIN')" +
" or hasAuthority('IS_CURATOR') and hasAuthority('READ_PROJECT:' + #projectId)" +
" or hasAuthority('READ_PROJECT:' + #projectId) and (returnObject['owner'] == authentication.name or returnObject['publicOverlay'])")
" or hasAuthority('READ_PROJECT:' + #projectId) and (returnObject['creator'] == authentication.name or returnObject['publicOverlay'])")
@GetMapping(value = "/{overlayId}/")
public Map<String, Object> getOverlayById(
@PathVariable(value = "projectId") String projectId,
......
......@@ -91,7 +91,7 @@ public class OverlayRestImpl extends BaseRestImpl {
}
result.put("images", images);
if (overlay.getCreator() != null) {
result.put("owner", overlay.getCreator().getLogin());
result.put("creator", overlay.getCreator().getLogin());
}
result.put("inputDataAvailable", overlay.getInputData() != null);
return result;
......
Supports Markdown
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