handlers: permisison check for all pages + retrieve user-specific permissions for pages (if any)

This commit is contained in:
2019-05-03 15:59:29 +02:00
parent e87c3a0f4d
commit 7630301168
23 changed files with 167 additions and 34 deletions

View File

@@ -21,6 +21,21 @@ SOFTWARE.
#include "handlerpagedelete.h"
#include "../database/exceptions.h"
bool HandlerPageDelete::pageMustExist()
{
return true;
}
bool HandlerPageDelete::canAccess(std::string page)
{
return effectivePermissions(page).canDelete();
}
std::string HandlerPageDelete::accessErrorMessage()
{
return "You don't have permission to delete pages";
}
Response HandlerPageDelete::handleRequest(PageDao &pageDao, std::string pagename, const Request &r)
{
try