casbin / casbin-cpp

An authorization library that supports access control models like ACL, RBAC, ABAC in C/C++
https://casbin.org
Apache License 2.0
223 stars 61 forks source link

Why enforcer has two herader files (casbin_enforcer.h and enforcer.h) ? #201

Closed MaximAxelrodFirebolt closed 2 years ago

MaximAxelrodFirebolt commented 2 years ago

Hi All,

I need to add a new constructor to the existing enforcer, Enforcer(const std::string& model_path, std::stringstream && policy), and I see that I must add the CTOR declaration in 2 files,

casbin/include/casbin/casbin_enforcer.h and contrib/casbin/casbin/enforcer.h

If I add the CTOR declaration only into one of them, compilation fails. So I just don't understand why casbin has two headers for enforcer?

What is the correct way to add a new constructor to enforcer?

casbin-bot commented 2 years ago

@EmperorYP7 @divy9881 @noob20000405 @sheny1xuan

sheny1xuan commented 2 years ago

Hi, current code only have one header file of enforcer. I think you should update your branch to the latest version.