use of org.obiba.mica.security.event.ResourceDeletedEvent in project mica2 by obiba.
the class DataAccessRequestResource method delete.
@DELETE
public Response delete(@PathParam("id") String id) {
subjectAclService.checkPermission("/data-access-request", "DELETE", id);
try {
dataAccessRequestService.delete(id);
// remove associated comments
commentsService.delete(DataAccessRequest.class.getSimpleName(), id);
eventBus.post(new ResourceDeletedEvent("/data-access-request", id));
eventBus.post(new ResourceDeletedEvent("/data-access-request/" + id, "_status"));
} catch (NoSuchDataAccessRequestException e) {
// ignore
}
return Response.noContent().build();
}
use of org.obiba.mica.security.event.ResourceDeletedEvent in project mica2 by obiba.
the class CommentResource method deleteComment.
@DELETE
public Response deleteComment(@PathParam("id") String id, @PathParam("commentId") String commentId) {
subjectAclService.checkPermission(String.format("/draft/%s/%s/comment", service.getTypeName(), id), "DELETE", commentId);
service.findDraft(id);
commentsService.delete(commentId);
eventBus.post(new ResourceDeletedEvent(String.format("/draft/%s/%s/comment", service.getTypeName(), id), commentId));
return Response.noContent().build();
}
use of org.obiba.mica.security.event.ResourceDeletedEvent in project mica2 by obiba.
the class DataAccessRequestResource method deleteComment.
@DELETE
@Path("/comment/{commentId}")
public Response deleteComment(@PathParam("id") String id, @PathParam("commentId") String commentId) {
subjectAclService.checkPermission("/data-access-request/" + id + "/comment", "DELETE", commentId);
dataAccessRequestService.findById(id);
commentsService.delete(commentId);
eventBus.post(new ResourceDeletedEvent("/data-access-request/" + id + "/comment", commentId));
return Response.noContent().build();
}
Aggregations