Introducing HandlerConfig class to give handlers config values they need
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#ifndef HANDLER_H
|
||||
#define HANDLER_H
|
||||
|
||||
#include "../config.h"
|
||||
#include "../response.h"
|
||||
#include "../request.h"
|
||||
#include "../template.h"
|
||||
@@ -17,14 +17,17 @@ class Handler
|
||||
Database *database;
|
||||
Session *userSession;
|
||||
UrlProvider *urlProvider;
|
||||
HandlerConfig *handlersConfig;
|
||||
|
||||
// TODO: may not to find a better place for this method
|
||||
Permissions effectivePermissions(std::string page);
|
||||
QueryOption queryOption(const Request &r) const;
|
||||
|
||||
public:
|
||||
Handler(Template &templ, Database &db, Session &userSession, UrlProvider &provider, ICache &cache)
|
||||
Handler(HandlerConfig &handlersConfig, Template &templ, Database &db, Session &userSession, UrlProvider &provider,
|
||||
ICache &cache)
|
||||
{
|
||||
this->handlersConfig = &handlersConfig;
|
||||
this->templ = &templ;
|
||||
this->database = &db;
|
||||
this->userSession = &userSession;
|
||||
|
Reference in New Issue
Block a user