diff --git a/modules/rbac_users/SCsub b/modules/rbac_users/SCsub new file mode 100644 index 0000000..33e2978 --- /dev/null +++ b/modules/rbac_users/SCsub @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +Import("env_mod") +Import("env") + +env_mod.core_sources = [] + +env_mod.add_source_files(env_mod.core_sources, "*.cpp") + +# Build it all as a library +lib = env_mod.add_library("users", env_mod.core_sources) +env.Prepend(LIBS=[lib]) diff --git a/modules/rbac_users/detect.py b/modules/rbac_users/detect.py new file mode 100644 index 0000000..cf9500e --- /dev/null +++ b/modules/rbac_users/detect.py @@ -0,0 +1,33 @@ +import os +import platform +import sys + + +def is_active(): + return True + + +def get_name(): + return "users" + + +def can_build(): + return True + + +def get_opts(): + return [] + +def get_flags(): + + return [] + + +def configure(env): + pass + +def get_module_dependencies(): + return [ + "users", + "rbac" + ] \ No newline at end of file diff --git a/modules/rbac_users/rbac_user.cpp b/modules/rbac_users/rbac_user.cpp new file mode 100644 index 0000000..5a647a4 --- /dev/null +++ b/modules/rbac_users/rbac_user.cpp @@ -0,0 +1,8 @@ +#include "rbac_user.h" + +RBACUser::RBACUser() : + User() { +} + +RBACUser::~RBACUser() { +} diff --git a/modules/rbac_users/rbac_user.h b/modules/rbac_users/rbac_user.h new file mode 100644 index 0000000..6b9c627 --- /dev/null +++ b/modules/rbac_users/rbac_user.h @@ -0,0 +1,19 @@ +#ifndef RBAC_USER_H +#define RBAC_USER_H + +#include "core/string.h" + +#include "modules/users/user.h" + +class Request; +class FormValidator; + +class RBACUser : public User { + RCPP_OBJECT(RBACUser, User); + +public: + RBACUser(); + ~RBACUser(); +}; + +#endif \ No newline at end of file diff --git a/modules/rbac_users/rbac_user_controller.cpp b/modules/rbac_users/rbac_user_controller.cpp new file mode 100644 index 0000000..9617c94 --- /dev/null +++ b/modules/rbac_users/rbac_user_controller.cpp @@ -0,0 +1,8 @@ +#include "rbac_user_controller.h" + +RBACUserController::RBACUserController() : + UserController() { +} + +RBACUserController::~RBACUserController() { +} diff --git a/modules/rbac_users/rbac_user_controller.h b/modules/rbac_users/rbac_user_controller.h new file mode 100644 index 0000000..6c42847 --- /dev/null +++ b/modules/rbac_users/rbac_user_controller.h @@ -0,0 +1,16 @@ +#ifndef RBAC_USER_CONTROLLER_H +#define RBAC_USER_CONTROLLER_H + +#include "modules/users/user_controller.h" + +class RBACUserController : public UserController { + RCPP_OBJECT(RBACUserController, UserController); + +public: + RBACUserController(); + ~RBACUserController(); + +protected: +}; + +#endif \ No newline at end of file diff --git a/modules/rbac_users/rbac_user_initializer.cpp b/modules/rbac_users/rbac_user_initializer.cpp new file mode 100644 index 0000000..94fa166 --- /dev/null +++ b/modules/rbac_users/rbac_user_initializer.cpp @@ -0,0 +1,37 @@ +#include "rbac_user_initializer.h" + +void UserInitializer::allocate_controller() { + ERR_FAIL_COND(_controller); + + _controller = new RBACUserController(); +} +void UserInitializer::free_controller() { + if (_controller) { + delete _controller; + _controller = nullptr; + } +} + +void UserInitializer::allocate_model() { + ERR_FAIL_COND(_model); + + _model = new RBACUserModel(); +} +void UserInitializer::free_model() { + if (_model) { + delete _model; + _model = nullptr; + } +} + +void UserInitializer::allocate_all() { + allocate_model(); + allocate_controller(); +} +void UserInitializer::free_all() { + free_controller(); + free_model(); +} + +RBACUserController *UserInitializer::_controller = nullptr; +RBACUserModel *UserInitializer::_model = nullptr; \ No newline at end of file diff --git a/modules/rbac_users/rbac_user_initializer.h b/modules/rbac_users/rbac_user_initializer.h new file mode 100644 index 0000000..0369a0f --- /dev/null +++ b/modules/rbac_users/rbac_user_initializer.h @@ -0,0 +1,23 @@ +#ifndef USER_INITIALIZER_H +#define USER_INITIALIZER_H + +#include "rbac_user_model.h" +#include "rbac_user_controller.h" + +class UserInitializer { +public: + static void allocate_controller(); + static void free_controller(); + + static void allocate_model(); + static void free_model(); + + static void allocate_all(); + static void free_all(); + +protected: + static RBACUserController *_controller; + static RBACUserModel *_model; +}; + +#endif \ No newline at end of file diff --git a/modules/rbac_users/rbac_user_model.cpp b/modules/rbac_users/rbac_user_model.cpp new file mode 100644 index 0000000..dac5062 --- /dev/null +++ b/modules/rbac_users/rbac_user_model.cpp @@ -0,0 +1,9 @@ +#include "rbac_user_model.h" + + +RBACUserModel::RBACUserModel() : + UserModel() { +} + +RBACUserModel::~RBACUserModel() { +} diff --git a/modules/rbac_users/rbac_user_model.h b/modules/rbac_users/rbac_user_model.h new file mode 100644 index 0000000..a8f4724 --- /dev/null +++ b/modules/rbac_users/rbac_user_model.h @@ -0,0 +1,16 @@ +#ifndef RBAC_USER_MODEL_H +#define RBAC_USER_MODEL_H + +#include "modules/users/user_model.h" + +class RBACUserModel : public UserModel { + RCPP_OBJECT(RBACUserModel, UserModel); + +public: + RBACUserModel(); + ~RBACUserModel(); + +protected: +}; + +#endif \ No newline at end of file