some ezc functions from templates/item.cpp moved to Item and ItemContent

methods HasAccess() HasReadAccess() and similar moved from System to Item and ItemContent
This commit is contained in:
2021-06-18 19:18:13 +02:00
parent ebd791a256
commit ec94dff7d7
32 changed files with 1255 additions and 544 deletions

View File

@@ -118,6 +118,9 @@ App::App()
plugin.SetWinixRequest(&winix_request);
req.SetConfig(&config);
req.set_connector(&model_connector);
functions.set_dependency(&winix_request);
// functions.set_config(&config);
@@ -337,6 +340,7 @@ bool App::Init()
model_connector.set_winix_users(&system.users);
model_connector.set_winix_groups(&system.groups);
model_connector.set_winix_session_logger(nullptr); // will be set for each request
model_connector.set_winix_session(nullptr); // will be set for each request
if( !TryToMakeDatabaseMigration() )
return false;
@@ -564,8 +568,13 @@ void App::ProcessRequestThrow()
cur.mount = system.mounts.CalcCurMount();
cur.session = session_manager.PrepareSession();
model_connector.set_winix_session(cur.session);
functions.CheckFunctionAndSymlink(); // here a function can be changed
cur.session = session_manager.CheckIfFunctionRequireSession();
model_connector.set_winix_session(cur.session);
SetLocale();
if( cur.session->new_session )
@@ -624,6 +633,9 @@ void App::ProcessRequest()
{
try
{
cur.request->set_connector(model_connector);
model_connector.set_winix_request(cur.request);
cur.request->RequestStarts();
system.load_avg.StartRequest();
log << log2 << config.log_delimiter << logend;
@@ -680,7 +692,11 @@ void App::ClearAfterRequest()
system.mounts.pmount = cur.mount; // IMPROVE ME system.mounts.pmount will be removed
// send_data_buf doesn't have to be cleared and it is better to not clear it (optimizing)
cur.request->item.set_connector(nullptr);
model_connector.set_winix_request(nullptr);
model_connector.set_winix_session(nullptr);
model_connector.set_winix_session_logger(nullptr);
cur.request->item.set_connector(nullptr); // it is needed?
log << logendrequest;
}