2021-10-31 21:45:12 +01:00
|
|
|
#ifndef RBAC_CONTROLLER_H
|
|
|
|
#define RBAC_CONTROLLER_H
|
|
|
|
|
2021-11-01 16:39:30 +01:00
|
|
|
#include <map>
|
|
|
|
|
2021-10-31 23:12:05 +01:00
|
|
|
#include "modules/admin_panel/admin_controller.h"
|
2021-10-31 21:45:12 +01:00
|
|
|
|
2021-11-01 16:39:30 +01:00
|
|
|
#include "core/containers/vector.h"
|
|
|
|
#include "core/string.h"
|
|
|
|
|
|
|
|
#include "rbac_permission.h"
|
|
|
|
#include "rbac_rank.h"
|
2021-10-31 21:45:12 +01:00
|
|
|
|
|
|
|
class Request;
|
|
|
|
class FormValidator;
|
|
|
|
|
2021-10-31 23:12:05 +01:00
|
|
|
class RBACController : public AdminController {
|
|
|
|
RCPP_OBJECT(RBACController, AdminController);
|
2021-10-31 21:45:12 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
void handle_request_main(Request *request);
|
|
|
|
void create_validators();
|
|
|
|
|
2021-11-01 15:12:09 +01:00
|
|
|
void admin_handle_request_main(Request *request);
|
2021-11-01 01:39:55 +01:00
|
|
|
void admin_add_section_links(Vector<AdminSectionLinkInfo> *links);
|
|
|
|
|
2021-11-01 16:39:30 +01:00
|
|
|
void initialize();
|
|
|
|
|
2021-10-31 21:45:12 +01:00
|
|
|
static RBACController *get_singleton();
|
|
|
|
|
|
|
|
RBACController();
|
|
|
|
~RBACController();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static RBACController *_self;
|
2021-11-01 16:39:30 +01:00
|
|
|
|
|
|
|
std::map<int, Ref<RBACRank> > _permissions;
|
2021-10-31 21:45:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|