2021-10-31 21:45:12 +01:00
|
|
|
#ifndef RBAC_MODEL_H
|
|
|
|
#define RBAC_MODEL_H
|
|
|
|
|
|
|
|
#include "core/http/model.h"
|
|
|
|
|
2021-11-01 16:39:30 +01:00
|
|
|
#include <map>
|
|
|
|
#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 RBACModel : public Model {
|
|
|
|
RCPP_OBJECT(RBACModel, Model);
|
|
|
|
|
|
|
|
public:
|
2021-11-09 22:55:53 +01:00
|
|
|
virtual std::map<int, Ref<RBACRank> > load_ranks();
|
2021-11-01 16:39:30 +01:00
|
|
|
|
|
|
|
virtual void save(const Ref<RBACRank> &rank);
|
|
|
|
virtual void save_rank(const Ref<RBACRank> &rank);
|
|
|
|
virtual void save_permission(const Ref<RBACPermission> &permission);
|
2021-11-10 19:53:56 +01:00
|
|
|
virtual int get_default_rank();
|
2021-11-10 20:08:42 +01:00
|
|
|
virtual String get_redirect_url();
|
2021-10-31 21:45:12 +01:00
|
|
|
|
|
|
|
void create_table();
|
|
|
|
void drop_table();
|
|
|
|
void migrate();
|
2021-11-10 19:53:56 +01:00
|
|
|
virtual void create_default_entries();
|
2021-10-31 21:45:12 +01:00
|
|
|
|
|
|
|
static RBACModel *get_singleton();
|
|
|
|
|
|
|
|
RBACModel();
|
|
|
|
~RBACModel();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static RBACModel *_self;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|