diff --git a/handlers/handlerpageview.cpp b/handlers/handlerpageview.cpp index 232f52a..1ad121a 100644 --- a/handlers/handlerpageview.cpp +++ b/handlers/handlerpageview.cpp @@ -92,7 +92,11 @@ Response HandlerPageView::handleRequest(PageDao &pageDao, std::string pagename, { if(!effectivePermissions(pagename).canSeePageHistory()) { - return errorResponse("Error", "You are not allowed to view older revisions of this page"); + auto current = this->database->createRevisionDao()->getCurrentForPage(pagename); + if(current && current->revision > revisionid) + { + return errorResponse("Error", "You are not allowed to view older revisions of this page"); + } } revision = this->database->createRevisionDao()->getRevisionForPage(pagename, revisionid); if(!revision)