use of org.olat.modules.lecture.model.LectureBlockRefImpl in project openolat by klemens.
the class LectureBlocksWebService method getLectureBlockWebService.
/**
* To get the web service for a specific lecture block.
* @param lectureBlockKey The primary key of the lecture block
* @param httpRequest The HTTP request
* @return The web service for a single lecture block.
*/
@Path("{lectureBlockKey}")
public LectureBlockWebService getLectureBlockWebService(@PathParam("lectureBlockKey") Long lectureBlockKey, @Context HttpServletRequest httpRequest) {
Roles roles = getRoles(httpRequest);
if (!roles.isOLATAdmin()) {
return null;
}
LectureBlock lectureBlock = lectureService.getLectureBlock(new LectureBlockRefImpl(lectureBlockKey));
if (lectureBlock == null || !lectureBlock.getEntry().equals(entry)) {
return null;
}
return new LectureBlockWebService(lectureBlock, entry, lectureService);
}
Aggregations