diff --git a/app/mourne_application.cpp b/app/mourne_application.cpp index 10e4702..7cd4f86 100644 --- a/app/mourne_application.cpp +++ b/app/mourne_application.cpp @@ -14,9 +14,9 @@ #include "core/http/http_session.h" #include "core/http/session_manager.h" +#include "modules/admin_panel/admin_panel.h" #include "modules/users/user.h" #include "modules/users/user_controller.h" -#include "modules/admin_panel/admin_panel.h" #include "buildings/building_initializer.h" #include "village/village_initializer.h" @@ -69,6 +69,20 @@ void MourneApplication::add_menu(Request *request, const MenuEntries index) { HTMLTag *t; + int userlevel = 0; + + if (request->session) { + Ref user = request->reference_data["user"]; + + if (user.is_valid()) { + userlevel = user->rank; + } + } + + if (userlevel > 4) { + request->head += admin_headers; + } + /*