use of fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceJournalEntry in project muikku by otavanopisto.
the class WorkspaceRESTService method updateJournalEntry.
@DELETE
@Path("/workspaces/{WORKSPACEID}/journal/{JOURNALENTRYID}")
@RESTPermit(handling = Handling.INLINE, requireLoggedIn = true)
public Response updateJournalEntry(@PathParam("WORKSPACEID") Integer workspaceId, @PathParam("JOURNALENTRYID") Long journalEntryId) {
WorkspaceJournalEntry workspaceJournalEntry = workspaceJournalController.findJournalEntry(journalEntryId);
if (workspaceJournalEntry == null) {
return Response.status(Status.NOT_FOUND).build();
}
if (!workspaceJournalEntry.getUserEntityId().equals(sessionController.getLoggedUserEntity().getId())) {
return Response.status(Status.FORBIDDEN).build();
}
workspaceJournalController.archiveJournalEntry(workspaceJournalEntry);
return Response.noContent().build();
}
Aggregations