mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Added a new rbac_user module.
This commit is contained in:
parent
60e22942e4
commit
93e95a865f
12
modules/rbac_users/SCsub
Normal file
12
modules/rbac_users/SCsub
Normal file
@ -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])
|
33
modules/rbac_users/detect.py
Normal file
33
modules/rbac_users/detect.py
Normal file
@ -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"
|
||||
]
|
8
modules/rbac_users/rbac_user.cpp
Normal file
8
modules/rbac_users/rbac_user.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
#include "rbac_user.h"
|
||||
|
||||
RBACUser::RBACUser() :
|
||||
User() {
|
||||
}
|
||||
|
||||
RBACUser::~RBACUser() {
|
||||
}
|
19
modules/rbac_users/rbac_user.h
Normal file
19
modules/rbac_users/rbac_user.h
Normal file
@ -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
|
8
modules/rbac_users/rbac_user_controller.cpp
Normal file
8
modules/rbac_users/rbac_user_controller.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
#include "rbac_user_controller.h"
|
||||
|
||||
RBACUserController::RBACUserController() :
|
||||
UserController() {
|
||||
}
|
||||
|
||||
RBACUserController::~RBACUserController() {
|
||||
}
|
16
modules/rbac_users/rbac_user_controller.h
Normal file
16
modules/rbac_users/rbac_user_controller.h
Normal file
@ -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
|
37
modules/rbac_users/rbac_user_initializer.cpp
Normal file
37
modules/rbac_users/rbac_user_initializer.cpp
Normal file
@ -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;
|
23
modules/rbac_users/rbac_user_initializer.h
Normal file
23
modules/rbac_users/rbac_user_initializer.h
Normal file
@ -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
|
9
modules/rbac_users/rbac_user_model.cpp
Normal file
9
modules/rbac_users/rbac_user_model.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "rbac_user_model.h"
|
||||
|
||||
|
||||
RBACUserModel::RBACUserModel() :
|
||||
UserModel() {
|
||||
}
|
||||
|
||||
RBACUserModel::~RBACUserModel() {
|
||||
}
|
16
modules/rbac_users/rbac_user_model.h
Normal file
16
modules/rbac_users/rbac_user_model.h
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user